[zeromq-dev] Improving latency using futexes?
steven.mccoy at miru.hk
Tue Nov 24 18:29:35 CET 2009
2009/11/24 Martin Sustrik <sustrik at 250bpm.com>
> I've did a little experiment with using futex instead of mutex to implement
> a simple semaphore object (applies to Linux only).
> My assumption was that by using futex directly we avoid an atomic operation
> that glibc mutex performs in user space before passing control to the
> However, I haven't seen any latency improvement whatsoever. Any ideas of
> why it is so? (My naive guess is that both threads to be synchronised by the
> semaphore were scheduled on the same core, thus the atomic operation was
> extremely fast as it haven't required any cache coherency measures, bus
> locking etc.)
I investigated this last week, the current NPTL threading system uses futex
in the same way as every F/OSS project does. Which means the only benefits
using futexes provide is if you are currently using the old Linux threading
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev