News for hackers. Stuff that matters.
Re:A collection of lock-free data structures written in stan... by tialaramex on Wednesday May 10, 2023 @07:38PM (#35895095)
Although it's not the code C++ will be using the Rust implementation is a bit easier to follow:

https://doc.rust-lang.org/src/std/sys/unix/locks/futex_mutex...

Unlock is just:: self.futex.swap(0, Release) -- if the value we get back is 2 then we know at least one thread is asleep waiting on this futex, so we need a system call to wake them, but in the uncontended case we're done immediately.

There are no comments on this comment yet.