[libcxx-commits] [PATCH] D126882: [libc++] Do not yield from __sp_mut::lock()
Dimitry Andric via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jun 4 07:45:12 PDT 2022
dim added a comment.
To answer my own question partially, the original commit is Howard's: rG088e37c77aafaec5ead8fbe7ebf918265e6b86f2 <https://reviews.llvm.org/rG088e37c77aafaec5ead8fbe7ebf918265e6b86f2>:
> Despite my pathological distrust of spin locks, the number just don't lie. I've put a small spin in __sp_mut::lock() on std::mutex::try_lock(), which is testing quite well. In my experience, putting in a yield for every failed iteration is also a major performance booster. This change makes one of the performance tests I was using (a highly contended one) run about 20 times faster.
But this was on macOS at the time, so ~2012...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126882/new/
https://reviews.llvm.org/D126882
More information about the libcxx-commits
mailing list