Deadlocks
This lesson gives an overview of deadlocks which might occur during implementation of concurrency in C++.
A deadlock is a state in which two or more threads are blocked because each thread waits for the release of a resource before it releases its own resource.
There are two main reasons for deadlocks:
- A mutex has not been unlocked.
- You lock your mutexes in a different order.
For overcoming the second issue, techniques such as
For the details about deadlocks and how to overcome them with modern C++, read the subsection issues of mutexes and locks.
Get hands-on with 1400+ tech skills courses.