Dealing with Mutation: Locking -- Rainer Grimm
Locking is a straightforward idea to protect a critical section. A critical section is a section of code that, at most, one thread can use at any time.
Dealing with Mutation: Locking
by Rainer Grimm
From the article:
Scoped locking is the idea of
RAIIapplied to a mutex. Scoped locking is also known as synchronized block and guard. The key idea of this idiom is to bind the resource acquisition and release to an object’s lifetime. As the name suggests, the lifetime of the object is scoped. Scoped means that the C++ run time is responsible for object destruction and, therefore, for releasing the resource.The class
ScopedLockimplements Scoped Locking.

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
C++ allows us to declare various forms of non-local objects: they usually live throughout the execution of the whole program. In this article, we’ll look at global variables, dynamic, and thread-local objects. We’ll also consider new features for safe initialization C++20.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held 
If you don’t share, no data races can happen. Not sharing means that your thread works on local variables. This can be achieved by copying the value, using thread-specific storage, or transferring the result of a thread to its associated future via a protected data channel.
Registration is now open for CppCon 2023! The conference starts on October 1 and will be held
There are many well-established patterns used in the concurrency domain. They deal with synchronization challenges such as sharing and mutation but also with concurrent architectures. Today, I will introduce and dive deeper into them in additional posts.