Re:The Fastest Mutexes
by pizlonator on Wednesday October 02, 2024 @05:28PM
(#41725128)
Yeah! For all we know this performs great on real programs.
And for all we know it’s absolute trash on real programs.
A mutex that sleeps for a fixed amount (for example 100us) on lock failure acquisition will probably get very close to that behavior (since it almost always bunches), and "win" the benchmark. Still, that would be a terrible mutex for any practical application where there is any contention.
This is not to say that this mutex is not good (or that pthread mutexes are not bad), just that the microbenchmark in question does not measure anything that predicts performance in a real application.