Implementing Simple Futures with Coroutines
Instead of return, a coroutine uses co_return returning its result. In this post, I want to implement a simple coroutine using co_return.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 691 entries already.
Instead of return, a coroutine uses co_return returning its result. In this post, I want to implement a simple coroutine using co_return.
What happens when you write without synchronization to std::cout? You get a mess. With C++20, this should not be anymore.
Last week, I launched a quiz. The price was it to win one of the five vouchers for my book “C++20“.
std::jthread stands for joining thread. In addition to std::thread (C++11), std::jthread automatically joins in its destructor and can cooperatively be interrupted. Read this post to know why std::jthread should be your first choice.
I’m happy to announce a guest post about Time Travel Debugging with UDB. At the end of the post, I have a bonus.
A typical question in my C++ seminars is: Can a thread be killed? Before C++20, my answer is no. With C++20, you can ask a thread politely for its interruption.
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 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.
Semaphores are a synchronization mechanism used to control concurrent access to a shared resource. They also allow it to play ping-pong.
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.