To be fair, it's a sleep(0), which I assume is just the easiest way to get the process to context switch. I assume this is a speed improvement only when locks become ready sooner than a context switch.
The real fix would be to make context switches faster, this is just a data-driven tweak rather than a general solution.
Comments
To be fair, it's a sleep(0), which I assume is just the easiest way to get the process to context switch. I assume this is a speed improvement only when locks become ready sooner than a context switch.
The real fix would be to make context switches faster, this is just a data-driven tweak rather than a general solution.