That one time without the mutex

Peter Naulls
Nov 30, 2019 · 3 min read

Every developer who starts with threading soon learns about the necessity of locking structures. The reason is pretty simple — if your program has two threads of execution, and there’s any chance at all one of them will alter the structure, then you need to lock between them.

The exact way you do this varies a bit by language, but the old school way of doing this in C and C++ is with a boring mutex, which…