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

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

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 created a ping-pong game using condition variables, std::atomic_flag and std::atomic<bool>. Let's play.

Read more
Views: 44584

Synchronization with Atomics in C++20

Sender/receiver workflows are pretty 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: 29816

Atomic References with C++20

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

Read more
Tags: Atomics
Views: 21756

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

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

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

Atomic Smart Pointers

C++20 will have atomic smart pointers. To be exact, 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: 176324

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

Stay Informed about my Mentoring

 

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

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

Course: Master Software Design Patterns and Architecture in C++

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code

Visitors

Today 1805

Yesterday 4344

Week 38683

Month 18929

All 12097138

Currently are 160 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments