Atomics

Dining Philosophers Problem II

In the last post "Dining Philosophers Problem I", Andre Adrian started his analysis of the classical dining philosophers' problem. Today, he uses atomics, mutexes, and locks.

Read more
Views: 5170

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

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

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

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

C++20: Concurrency

This post concludes my overview of C++20. Today's post is about the concurrency features in the next C++ standard.

Read more
Views: 43239

ABA - A is not the same as A

A common problem in concurrency is the so-called ABA problem. That means you read a value twice and each time it returns the same value A. Therefore you conclude that nothing changed in between. But you forgot the B.

Read more
Tags: Atomics
Views: 29131

Blocking and Non-Blocking Algorithms

Blocking, non-blocking, lock-free, and wait-free. Each of these terms describes a key characteristic of an algorithm when executed in a concurrent environment. So, reasoning about the runtime behavior of your program often means putting your algorithm in the right bucket. Therefore, this post is about buckets.

Read more
Views: 67012

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
Views: 172138

My Conclusion: Summation of a Vector in three Variants

After I've calculated in three different ways the sum of a std::vector I want to draw my conclusions.

Read more
Views: 35891

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 1117

Yesterday 4552

Week 42231

Month 186402

All 11667556

Currently are 122 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments