Don't Sleep(1) in some spin-wait loops (dotnet/coreclr#21722)
- In spin-wait loops that are not expected to last too long, Sleep(1) significantly delays threads from completing the operation
- From eliminating Sleep(1) in such spin-wait loops, there can be a tradeoff, better fairness vs worse throughput, because Sleep(1) removes threads from contention and in some cases fewer threads can make faster progress at the cost of delaying the Sleep(1) threads relatively significantly. Eliminating the Sleep(1) in such spin-wait loops seems to be a good tradeoff.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7bd31ac770062fdcf75ad19dabcd7c8ba60bc29c