Dealing with Mutation: Guarded Suspension -- Rainer Grimm
Guarded Suspension applies a unique strategy to deal with mutation. It signals when it is done with its modification.
Dealing with Mutation: Guarded Suspension
by Rainer Grimm
From the article:
The guarded suspension basic variant combines a lock and a precondition that must be satisfied. If the precondition is not fulfilled, that checking thread puts itself to sleep. The checking thread uses a lock to avoid a race condition that may result in a data race or a deadlock.
Various variants of the Guarded Suspension exist:
- The waiting thread can passively be notified about the state change or actively ask for the state change. In short, I call this push versus pull principle.
- The waiting can be done with or without a time boundary.
- The notification can be sent to one or all waiting threads.
I present in this post only the rough idea. Let me start with the push principle.
You often synchronize threads with a condition variable or a future/promise pair. The condition variable or the promise sends the notification to the waiting thread. A promise has no
notify_oneornotify_allmember function. Typically, a valuelessset_valuecall is used to ...

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
Recently, our team at Meteksan Defense is upgrading its development environment to use newer versions of many tools and programming languages. One of the more difficult transitions has been the upgrade of our C++11 code base to C++17 for our embedded applications.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
On October 2,
Suppose you want to write a template function that accepts any specialization of
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
I continue my journey with concurrency patterns in today's post. The Thread-Safe Interface fits very well when the critical sections are just objects.