Hacker News new | ask | show | jobs
by gpderetta 3361 days ago
note that every half decent mutex implementation will not enter the kernel (in neither lock or unlock) unless the mutex is contended.
2 comments

Sure, but OP's benchmark clearly shows that OS X's default mutex is at most 5% decent ;)
I'd love to see them perform the same benchmark on macOS 10.12. Pthread mutexes were sped up in "the new OSes" according to a tweet made last year (sorry no link), though I'm not sure if that was referring to 10.11 or 10.12. Either way, the benchmark should perform better now, and I'm curious how much. I'd run it myself except those numbers wouldn't be comparable to OP's Mac Mini benchmark. Of course, OP's Linux benchmark numbers aren't either, because it's a different (and probably much more powerful) machine.
...which comes back to my point that old truths are more likely just not as true anymore.