Entries by Rainer Grimm

A Lock-Free Stack: A Simplified Implementation

Today, I continue my mini story about lock-free data structures. General Considerations From the outside, the caller’s responsibility (application) is to protect the data. From inside, the data structure is responsible for protecting itself. A data structure that protects itself so a data race cannot appear is called thread-safe. First, what general considerations must you […]

Deferred Reclamation in C++26: Read-Copy Update and Hazard Pointers

Before I dive into lock-free programming, there’s a little bit of theory necessary. A common problem in concurrency is the so-called ABA problem. That means you read a variable twice, which returns the same value each time, A. Therefore, you conclude that nothing changed in between. But you forgot the B. Let me first use […]

std::format Extension

Displaying the address of an arbitrary pointer in C++ 20 fails but succeeds with C++26. C++20 Only void, const void, and std::nullptr_t pointer types are valid. If you want to display the address of an arbitrary pointer, you must cast it to (const) void*. // formatPointer20.cpp #include <format> #include <iostream> #include <string> int main() { […]

C++26 Library: string and string_view Processing

C++26 offers many small improvements around strings and string_views. First of all: What is a string_view? std::string_view A std::string_view is a non-owning reference to a string. It represents a view of a sequence of characters. This sequence of characters can be a C++ string or a C-string. In a typical way, C++17 offers four type […]

My ALS Journey (19/n): The Never Ending Story

Today, I present a sad story, and I can only take it by humor. >> My ALS Journey so far << My Electrical Wheelchair I need an electric wheelchair badly. This wheelchair should also support standing and sleeping. With this wheelchair, I can move inside and outside my flat and visit friends, things I could […]

Last Chance- 1 Day Left

Make the Difference Let’s do something great together: From December 1st to 24th, when you book one of my mentoring programs, I will donate half of the money to ALS research. I will publish an update each week so we can see what we have achieved so far. Here’s more information about me, the structure […]

std::execution: More Senders

std::execution offers three types of senders: factories, adapters, and consumers. I’ll take a closer look at these today. Most of the following content is from proposal P2300R10. I will try to represent it more concisely. Sender Factory A sender factory is an algorithm that takes no senders as parameters and returns a sender. I already […]

Christmas Special – 5 Days Left

Make the Difference Let’s do something great together: From December 1st to 24th, when you book one of my mentoring programs, I will donate half of the money to ALS research. I will publish an update each week so we can see what we have achieved so far. Here’s more information about me, the structure […]

Christmas Special – 7 Days Left

Make the Difference Let’s do something great together: From December 1st to 24th, when you book one of my mentoring programs, I will donate half of the money to ALS research. I will publish an update each week so we can see what we have achieved so far. Here’s more information about me, the structure […]