13 ms·
How does it know that said critical section is short? Guessing? Likely a hard linear-quadratic expanding threshold. They tend to waste a lot of CPU power in sp
by AstralStorm 7y ago
How does it know that said critical section is short? Guessing?
Likely a hard linear-quadratic expanding threshold. They tend to waste a lot of CPU power in specific algorithms.
There are better, more intrusive ways of solving this problem on language level.
- bdash 7y agoIt doesn't attempt to determine the size of the critical section, AFAIK. I think it's saying that sleeping immediately when failing to acquire the lock would significantly hurt small critical sections, and so instead they spin a few times to avoid punishing those scenarios.