News for hackers. Stuff that matters.
Re:Mutexes are faster than Spinlocks by extropy on Saturday January 04, 2020 @04:42PM (#21957791)
How about a new opcode wait till memory address read equals? That would allow implementing a power efficient spinlock.

Oh there is one already. Meet PAUSE: https://www.felixcloutier.com/x86/pause

Edit: related post from 2018 https://news.ycombinator.com/item?id=17336853

Re:Mutexes are faster than Spinlocks by dbaupp on Saturday January 04, 2020 @04:49PM (#21957826)
Re:Mutexes are faster than Spinlocks by jnordwick on Saturday January 04, 2020 @06:39PM (#21958462)
MONITOR/MWAIT will get you the part where a thread will pause and the cpu can rest until a write on a store on an address range, then the waiting thread is allowed to continue. You can't wait on a specific value though.