News for hackers. Stuff that matters.
Re:Ditch your (mut)ex, you deserve better by gpderetta on Thursday November 20, 2025 @04:35AM (#45990813)
Not if you have multiple schedulers. Case in point: asio.strand or execution::on [1].

And even with one scheduler it makes sense to explicitly mark your critical sections.

Really, at the end of the day the primary purpose of a mutex is serialization of all operations on some data. The blocking behaviour is just a way to implement it.

[1] https://en.cppreference.com/w/cpp/execution/on.html

Re:Ditch your (mut)ex, you deserve better by mgaunard on Thursday November 20, 2025 @02:38PM (#45996722)
Mutexes are a problematic pattern that doesn't compose, see the article.