Closed anton-malakhov closed 4 years ago
Hi @anton-malakhov, yes the current implementation is rather simplistic. Given enough time I will look into this. However would you like to propose a PR instead? I notice boost has a cross-platform implementation which could potentially be used.
Describe the bug SpinLock as it is implemented in Quantum kills neighbor HyperThread performance and consumes excessive power.
Proposal Use PAUSE instruction (
_mm_pause();
intrinsic) for short-duration lock. Use a back-off algorithm to gradually reduce bus traffic used for the atomic checks. Insert co-op yield point if it takes too long to acquire the lock.Additional context