Entries by Rainer Grimm

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 detach himself from his child. But that is not new. But that will not hold for std::async. The big charm of std::async is that the parent has not taken care of his child.

Tasks

Tasks were one of the latest additions to the C++11 standard. They give you a better abstraction than threads. In the general case, they should be your first choice. 

Condition Variables

Condition variables allow us to synchronize threads via notifications. So, you can implement workflows like sender/receiver or producer/consumer. In such a workflow, the receiver waits for the sender’s notification. If the receiver gets the notification, it continues its work.