June 2017
Intermediate to advanced
532 pages
12h 59m
English
The code of this section contains two pairs of functions that ought to be executed by concurrent threads, and that acquire two resources in form of mutexes. One pair provokes a deadlock and the other avoids it. In the main function, we are going to try them out:
#include <iostream> #include <thread> #include <mutex> using namespace std; using namespace chrono_literals;
mutex mut_a; mutex mut_b;
Read now
Unlock full access