[zeromq-dev] Improving latency using futexes?
sustrik at 250bpm.com
Tue Nov 24 17:25:46 CET 2009
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.)
Those that like to mess with dark kernel magic, see the patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2229 bytes
Desc: not available
More information about the zeromq-dev