A new Thread with C++20: std::jthread

One of the participants in my CppCon 2018 workshop asked me: "Can a std::thread be interrupted?". No, was my answer but this is not correct anymore. With C++20 we might get a std::jthread.

Read more
Views: 139570

The End of my Detour: Unified Futures

After the last post to executors, I can now finally write about the unified futures. I write in the post about the long past of the futures and end my detour from the C++ core guidelines.

Read more
Views: 19434

A Short Detour: Executors

A few weeks ago, one of the authors of the proposal to the futures in C++ Felix Petriconi wrote me an E-Mail. He said my article about std::future Extensions is quite dated. Honestly, he is right. The future of the futures changed mainly because of executors.

Read more
Views: 50846

Task Blocks

Task blocks use the well-known fork-join paradigm for the parallel execution of tasks.

Read more
Tags: C++20
Views: 35393

Transactional Memory

Transactional memory is based on the idea of a transaction from the database theory. Transactional memory shall make the handling of threads a lot easier. That for two reasons. Data races and deadlocks disappear. Transactions are composable.

Read more
Tags: C++20
Views: 28006

Coroutines

Coroutines are functions that can suspend and resume their execution while keeping their state. The evolution in C++20 goes one step further.

Read more
Tags: C++20
Views: 77451

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: 43316

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: 44828

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: 140230

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: 65435

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

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

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 746

Yesterday 7029

Week 41070

Month 107736

All 7375576

Currently are 134 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments