Entries by Rainer Grimm

My ALS Journey (22/n): Call for Collaboration

Today, I have a special call for collaboration. >> My ALS Journey so far << My Challenge My writing skills are very poor, but my speaking is pretty good. I use my voice to write articles or programs. Dictating is very cumbersome and error-prone, and it takes four times as long to write a blog […]

A Lock-Free Stack: A Hazard Pointer Implementation Explained II

In my last post, I started to explain a hazard pointer implementation: A Lock-Free Stack: A Hazard Pointer Implementation Explained I. Today, I will continue to explain the implementation. The Retire List The retire list has the public member functions isInUse, addNode, and deleteUnusedNodes. Additionally, it has the inner class RetireNode, an atomic member of […]

A Lock-Free Stack: A Hazard Pointer Implementation Explained I

In my last post, I presented a hazard pointer implementation: A Lock-Free Stack: A Hazard Pointer Implementation. Today, I will explain the implementation. MyNode is a class template, parametrized by the type it holds: data. MyNode models the concept Node. template <typename T> concept Node = requires(T a) { {T::data}; { *a.next } -> std::same_as<T&>; […]

My ALS Journey (21/n): ALS Fundraiser by Jen and Jason

Today, I want to present you something special. >> My ALS Journey so far << ALS Fundraiser by Jen and Jason https://x.com/lefticus/status/1895996735610032400 I cannot express how happy I am to have such friends! Jen and Jason, have a good journey. From one Week to two Weeks You may have already noticed. I will change my […]

A Lock-Free Stack: A Hazard Pointer Implementation

Hazard Pointers solve all issues of the previous implementation: A Lock-Free Stack: A Simple Garbage Collector. From one Week to two Weeks You may have already noticed. I will change my blog publishing frequency from one to two weeks in the future. Writing a post using your voice is exceptionally exhausting and time-consuming. Hazard Pointers […]

A Lock-Free Stack: A Simple Garbage Collector

My next lock-free stack includes a simple garbage collector. I discussed the concurrent execution of more than one topAndPush call is a Race Condition. I can safely delete a node if not more than one topAndPush call is executing concurrently. This observation is crucial for solving this memory leak issue: I store removed nodes on […]

A Lock-Free Stack: Atomic Smart Pointer

The easiest way to solve this memory leak issue from the last post is to use a std::shared_ptr. Atomic Smart Pointer There are two ways to apply atomic operations on a std::shared_ptr: In C++11, you can use the free atomic functions on std::shared_ptr. With C++20, you can use atomic smart pointers. C++11 Using atomic operations […]

A Lock-Free Stack: A Complete Implementation

My last lock-free stack implementation was incomplete. It only supported push operations. Let’s change this. The following paragraph about sequential consistency is optional. You can easily ignore it. Sequential Consistency In my examples, I use the default memory ordering: sequential consistency. The reason is simple. Sequential consistency provides the strongest guarantees of all memory ordering […]

My ALS Journey (20/n): Aids

Today, I would like to introduce all the important aids that allow me and Beatrix to get through the day >> My ALS Journey so far << Aids Caregivers Of course, caregivers are not aids, but they still belong on this list. I can now have 24/7 care. This care is an incredible help for […]