mortoray.com
How does a mutex work? What does it cost?
Concurrent programming requires synchronization. We can’t have more than one thread accessing data at the same time; otherwise, we end up with a data race. The most common solution is to wrap…