[zeromq-dev] Improving latency using futexes?

Steven McCoy 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
> kernel.
> 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...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20091124/a3b68004/attachment.htm>

More information about the zeromq-dev mailing list