MC++ BLOG
  • TOUR
    • Introduction
    • My Blog
    • Current Topics
    • My Portfolio
  • Table of Content
  • Blog
  • Portfolio
    • My Books
    • My Courses
    • My Mentoring
  • Contact Me
  • RSS Feed
  • Cookie Policy (EU)
  • Search
  • Menu Menu

Blog

You are here: Home1 / Blog

Start Here

Tag Cloud

acquire-release semantic (10) ADL (1) Allocator (5) Anti-Patterns (1) Arithmetic (1) Associative Containers (10) async (2) Atomics (29) atomic_thread_fence (2) auto (6) barriers (2) Bit Manipulation (1) C (1) chrono (22) Classes (14) Class Hierarchies (4) Concepts (28) condition variables (6) consteval (2) constexpr (12) constexpr if (2) constinit (2) Contracts (2) Control Structures (2) Conversions (2) Coroutines (22) CppMem (9) CRTP (3) Data Races (1) Declarations (3) decltype (2) Dependency Injection (1) Dependent Names (1) Dining Philosophers (2) enum (3) Error Handling (6) Exceptions (3) execution (5) Executors (2) Expressions (2) Expression Templates (2) final (1) finally (1) Fold Expressions (3) format (10) friend (1) Functions (3) GSL (3) Haskell (9) History (1) if (1) In/Output (4) Initialization (5) inline (1) Interfaces (3) iterator (2) jthread (3) Lambdas (9) latches (2) lock (11) lock-free (3) Memory (26) memory_order_consume (2) Mixins (1) Modules (12) Monads (1) Monostate (1) move (6) Multiple Inheritance (1) mutex (7) Myths (3) Naming (1) new/delete (8) nullptr (1) Ongoing Optimization (7) Outdated (11) Overloading (2) override (1) Ownership (1) Parallel STL (2) Performance (13) Pimpl (1) POD (1) Pointers (2) Policy (5) Polymorphism (2) Python (6) Race Conditions (2) RAII (1) Ranges (16) Reflection (4) Regular (2) Regular Expressions (3) Relaxed Semantics (7) Requires Expressions (1) Rule of Zero/Six (3) Safety (5) semaphores (3) Sequential Consistency (12) shared_ptr (7) Singleton (5) Slicing (1) Smart Pointers (13) Source Files (2) Spaceship (4) span (2) Statements (1) static (2) static_assert (2) string (4) switch (2) Tag Dispatching (3) Tasks (14) Template Metaprogramming (6) ThreadSanitizer (1) thread_local (3) Traits (1) Transactional Memory (1) type-traits (12) Type Erasure (3) union (1) unique_ptr (5) User-Defined Literals (2) Variadic Templates (5) variant (1) vector (1) Virtual Constructor (1) volatile (3) weak_ptr (1)

Source Code

Subscribe to the Newsletter

Latest news

  • Hazard Pointers in C++26May 5, 2025 - 11:12 am

    Hazard pointers provide garbage collection in C++ and solve the ABA problem. First of all. What is a hazard pointer? Proposal P2530R3 gives a nice explanation: A hazard pointer is a single-writer multi-reader pointer that can be owned by at most one thread at any time. Only the owner of the hazard pointer can set […]

  • A Lock-Free Stack: A Hazard Pointer Implementation Explained IIApril 7, 2025 - 11:11 am

    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 IMarch 24, 2025 - 11:37 am

    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&>; […]

  • A Lock-Free Stack: A Hazard Pointer ImplementationMarch 10, 2025 - 11:42 am

    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 CollectorFebruary 24, 2025 - 11:58 am

    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 PointerFebruary 17, 2025 - 11:47 am

    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 […]

Become a Patreon

Privacy Statement
Imprint
Disclaimer
Contact Me
© Copyright 2024 - Modernes C++ GmbH
  • Twitter
  • Facebook
  • LinkedIn
  • Vimeo
  • Xing
Scroll to top
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}