Sequential Consistency
/
0 Comments
The atomics are the base of the C++ memory model. Per default, sequential consistency is applied.
The…
The Atomic Flag
Atomics guarantee two characteristics. On the one hand, they are atomic, on the other, they provide synchronization…
Thread Synchronization with Condition Variables or Tasks
In case you use promise and future to synchronize threads, they have much in common with condition variables.…
C++ Memory Model
Since C++11, C++ has a memory model. It is the foundation for multithreading. Without it, multithreading…
The Special Futures
The parent of a thread has to take care of their child. The parent can wait until his child is done or…
Promise and Future
With std::promise and std::future, you have full control over the task.
Full control over the task
A…
Asynchronous Callable Wrappers
std::packaged_task enables you to write a simple wrapper for a callable, which you can invoke later.
std::packaged_task
To…
Asynchronous Function Calls
std:.async feels like an asynchronous function call. Under the hood std::async is a task. One, which…
Tasks
Tasks were one of the latest additions to the C++11 standard. They give you a better abstraction than…
Condition Variables
Condition variables allow us to synchronize threads via notifications. So, you can implement workflows…