Locks Mechanism
Locking Mechanism
I wanted to go through how locking is done instead of why? Though to put it simply, we need locks to achieve correctness of concurrent applications.
Threads
C++
- std::mutex is the basic unit of a lock.
- std::lock
- std::lock_guard