Entries by Rainer Grimm

Barriers and Atomic Smart Pointers in C++20

In my last post, I introduced latches in C++20. A latch enables its threads to wait until a counter becomes zero. Additionally to a latch, its big sibling barrier can be used more than once. Today, I write about barriers and present atomic smart pointers.

Latches in C++20

Latches and barriers are coordination types that enable some threads to wait until a counter becomes zero. You can use a std::latch only once, but you can use a std::barrier more than once. Today, I have a closer look at latches.

And the Winners are:

Last week,  I launched a quiz. The price was it to win one of the five vouchers for the book “The Modern C++ Programming Cookbook” 2en Edition by Marius Bancila.

I’m Proud to Present my New Book: C++20

I’m proud to present the early release of my book to C++20 on LeanPub. The book is 50 % done and has more than 300 pages and 150 code examples of content. I will update the book at least two times in 2021. Of course, you will get each update of the book.

Synchronization with Atomics in C++20

Sender/receiver workflows are pretty common for threads. In such a workflow, the receiver is waiting for the sender’s notification before it continues to work. There are various ways to implement these workflows. With C++11, you can use condition variables or promise/future pairs; with C++20, you can use atomics.