Bradley Kuszmaul of TokuDB fame pointed out that my benchmark for Green Mutexes used usleep to implement lock hold times of a few microseconds and that usleep(1) would sleep for much more than 1 microsecond. So I changed the test code to use gettimeofday to implement the lock hold time and repeated the tests.
There are a few differences with the new results. First, the lock hold time is now accurate when less than 50 microseconds. Second, the thread that holds the lock uses the CPU while waiting to unlock so CPU utilization should increase a small amount. I also report …
[Read more]