Tag: synchronization
3 posts
-
C++ Mutex & Lock — Mutual Exclusion and lock_guard
C++ mutex and locks: std::mutex, lock_guard, unique_lock, std::lock, scoped_lock, recursive_mutex, timed_mutex, and avoiding deadlocks.
-
std::condition_variable: Waiting on Events Without Spurious Wakeup and Lost Notify Bugs
How std::condition_variable really works: predicates, spurious wakeups, lost notifications, notify_one vs notify_all, timeouts and a clean shutdown path.
-
C++20 std::latch and std::barrier: Start Gates, Phased Work and Clean Exits
When to use C++20 std::latch vs std::barrier: start gates, phase loops with a completion step, arrive_and_drop, exception-safe count_down and count bugs.