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.

Read more
Views: 19443

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.

Read more
Tags: latches
Views: 82464

Semaphores in C++20

Semaphores are a synchronization mechanism used to control concurrent access to a shared resource. They also allow it to play ping-pong.

Read more
Views: 144393

Performance Comparison of Condition Variables and Atomics in C++20

After the introduction to std::atomic_flag in my last post Synchronization with Atomics in C++20, I want to dive deeper. Today, I create a ping-pong game using condition variables, std::atomic_flag, and std::atomic<bool>. Let's play.

Read more
Views: 42010

Synchronization with Atomics in C++20

Sender/receiver workflows are quite 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.

Read more
Views: 27660

Atomic References with C++20

Atomics receives a few important extensions in C++20. Today, I start with the new data type std::atomic_ref.

Read more
Tags: Atomics
Views: 20437

Bit Manipulation with C++20

This post concludes my presentation of library features in C++20. Today I write about the class std::source_location and a few functions for bit manipulation.

Read more
Views: 32874

Feature Testing with C++20

When your program's compilation broke with a brand-new C++20 feature, you often end with a few questions: Did I something wrong? Did I found a compiler bug? Does my compiler not yet support this feature? Thanks to the feature testing in C++20, the last question is easy to answer.

Read more
Views: 11560

Safe Comparisons of Integrals with C++20

 When you compare signed and unsigned integers, you may not get the result you expect. Thanks to the six std::cmp_* functions, there is a cure in C++20.

Read more
Views: 21658

Calendar and Time-Zones in C++20: Time-Zones

This post concludes my introduction to the chrono extension in C++20. Today I present the time-zones functionality.

Read more
Tags: Time
Views: 35564

Mentoring

Stay Informed about my Mentoring

 

English Books

Course: Modern C++ Concurrency in Practice

Course: C++ Standard Library including C++14 & C++17

Course: Embedded Programming with Modern C++

Course: Generic Programming (Templates)

Course: C++ Fundamentals for Professionals

Interactive Course: The All-in-One Guide to C++20

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code

Visitors

Today 3899

Yesterday 7411

Week 27127

Month 171298

All 11652452

Currently are 170 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments