Rich Felker 2ff714c613 spin in sem_[timed]wait before performing futex wait
empirically, this increases the maximum rate of wait/post operations
between two threads by 20-150 times on machines I tested, including
x86 and arm. conceptually, it makes sense to do some spinning because
semaphores are intended to be usable as a notification mechanism
between threads, not just as locks, and low-latency notification is a
valuable property to have.
2014-08-25 16:38:25 -04:00
..
2014-06-06 15:43:16 -04:00