News for hackers. Stuff that matters.
Re:Notes on Concurrency Bugs (2016) by vitus on Saturday May 28, 2022 @05:19PM (#31543962)
> forgetting to synchronize at all, inconsistent locking

At least for these two classes of categories, mutex usage at Google is broadly paired with compiler-enforced annotations to enforce that _all_ accesses to mutex-guarded member variables are done while holding the appropriate mutex.

https://abseil.io/docs/cpp/guides/synchronization#thread-ann...

(While yes, it can also help with deadlock avoidance as well, that tends to be trickier to enforce across the board, especially if the mutexes in question belong to different objects. There's separate deadlock detection baked into Abseil that's used primarily in non-production builds.)

There are no comments on this comment yet.