News for hackers. Stuff that matters.
Re:The Fastest Mutexes by senderista on Thursday October 03, 2024 @02:25PM (#41733410)
No, you shouldn’t be calling CAS in a tight loop, but rather a relaxed load to check if a CAS might be successful, with PAUSE equivalent after each load. After spinning for ~context switch latency you should back off with sched_yield before retrying the spin loop (and eventually start sleeping on backoff with exponential jitter etc).
Re:The Fastest Mutexes by xxs on Thursday October 03, 2024 @02:35PM (#41733519)
of course, there is very rarely any a naked CAS