There are several wait strategies. You will want to use spin lock in
production environments where you should have enough CPU cores anyway.
Remember, the 'real' work runs in another always running thread that
also uses a spin lock to wait for more work.
In dev environment or hosts that need to do lots of other stuff, you
definitely need another wait strategy.
Erik.
Op 31-10-11 21:38, Chris Burroughs wrote:
On 10/31/2011 04:23 AM, Erik van Oosten wrote:
That is not the point (mostly). While you're waiting for a lock, you can't
issue another IO request. Avoiding locking is worthwhile even if CPU is the
bottleneck. The advantage is that you'll get lower latency and also important,
less jitter.
/begin{Tangent}
Doesn't the Disruptor use a spin lock though? I would expect that to
not play nice if sharing a core with CPU bound threads doing 'real' work.
--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/