4 ms·
> The core of it seems to be that the most efficient way to write locks today is to spin for a bit on contention, then yield to the kernel if you've been waitin
by spacechild1 3y ago
> The core of it seems to be that the most efficient way to write locks today is to spin for a bit on contention, then yield to the kernel if you've been waiting to long.
This is an old idea and many real-world mutex implementation have been doing this since forever. Some even let you configure the spin count: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initializecriticalsectionandspincount https://learn.microsoft.com/en-us/windows/win32/api/synchapi...
- saagarjha 3y agoYeah this is nothing new, I'm just saying that Linux is looking to service this better.
- spacechild1 3y agoAlright, I was just tripping over the word "today", since this has already been true 20 years ago :)