Latches And Barriers

Latches and barriers are simple to thread synchronisation mechanism which enables it that some threads wait until a counter becomes zero. We will presumably in C++20 get latches and barriers in three variations: std::latch, std::barrier, and std::flex_barrier.

Read more
Tags: C++20
Views: 40804

std::future Extensions

Tasks in the form of promises and futures have in C++11 an ambivalent reputation. On the one hand, they are a lot easier to use than threads or condition variables; on the other hand, they have a great deficiency. They can not be composed. C++20 will overcome this deficiency.

Read more
Tags: C++20, tasks
Views: 42535

Atomic Smart Pointers

C++20 will have atomic smart pointers. To be exactly, we will get a std::atomic_shared_ptr and a std::atomic_weak_ptr. But why? std::shared_ptr and std::weak_ptr are already thread-safe. Sort of. Let me dive into the details.

Read more
Tags: C++20
Views: 131892

Parallel Algorithms of the Standard Template Library

The idea is quite simple. The Standard Template has more than 100 algorithms for searching, counting, and manipulating ranges and their elements. With C++17, 69 of them are overloaded and a few new ones are added. The overloaded and new algorithms can be invoked with a so-called execution policy. By using the execution policy, you can specify whether the algorithm should run sequential, parallel, or parallel and vectorise.

 

Read more
Tags: C++17
Views: 62585

Multithreading with C++17 and C++20

Forecasts about the future are difficult. In particular, when they are about C++20. Nevertheless, I will take a look into the crystal ball and will write in the next posts about, what we will get with C++17  and what we can hope for with C++20.

Read more
Tags: C++20, C++17
Views: 186562

Sleep and wait

The new time library is an important component of the threading interface. As well threads, locks, condition variables as future have an understanding of time. All four have in common that they can sleep, wait or block until a time point or for a time duration.

Read more
Tags: time
Views: 52241

The Three Clocks

A clock consists of a starting point and a time tick. C++ offers with std::chrono::system_clock, std::chrono::steady_clock, and std::chrono::high_resolution_clock three clocks.

Read more
Tags: time
Views: 141892

Time Duration

A time duration is the difference between two time points. It will be measured in time ticks.

Read more
Tags: time
Views: 34478

Time Point

The time point is defined by the starting point (epoch) and the additional time duration. It consists of the two components clock and time duration.

Read more
Tags: time
Views: 26309

The time Library

A blog, dealing with multithreading in modern C++ but not writing about the new time library is not complete. Especially, because I often used the time library in my posts to measure the performance of shortcode snippets. Therefore, I give in this post an overview of the components of the time library: time point, time duration, and clock. I will write in additional posts about each of these three components.

Read more
Tags: time
Views: 9854

My Newest E-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

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 830

Yesterday 7436

Week 30535

Month 170742

All 6610823

Currently are 256 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments