- Exercises
Explore exercises focused on multithreading in C++. Learn to apply suitable locking mechanisms like unique_lock and lock_guard to prevent data races. Understand how to safely manage shared data structures such as maps during concurrent access. This lesson guides you to implement thread synchronization effectively while solving practical programming challenges.
We'll cover the following...
We'll cover the following...
Task 1
- Adjust the program below by using a suitable lock:
std::unique_lockorstd::lock_guard.
You should not explicitly use a mutex.
Task 2
Implement a count-down counter from 10 – 0. It should count down in seconds steps.
...