acquire-release semantic

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 behaviour of your program often means putting your algorithm in the right bucket. Therefore, this post is about buckets.

Read more
Views: 54279

Thread-Safe Initialization of a Singleton

There are a lot of issues with the singleton pattern. I'm totally aware of that. But the singleton pattern is an ideal use case for a variable, which has only to be initialized in a thread-safe way. From that point on you can use it without synchronization. So in this post, I discuss different ways to initialize a singleton in a multithreading environment. You get the performance numbers and can reason about your uses cases for the thread-safe initialization of a variable.

Read more
Views: 283836

Ongoing Optimization: A Data Race with CppMem

But we can do better and further improve the acquire-release semantic of the last post. Why should x be an atomic? There is no reason. That was my first, but incorrect assumption. See why?

Read more
Views: 9207

Ongoing Optimization: Acquire-Release Semantic with CppMem

With the acquire-releae semantic, we break the sequential consistency. In the acquire-release semantic the synchronization takes place between atomic operations on the same atomic and not between threads.

Read more
Views: 10377

Acquire-Release Fences

Acquire and release fences guarantees similar synchronisation and ordering constraints as atomics with acquire-release semantic. Similar, because the differences are in the details.

Read more
Views: 34899

Fences are Memory Barriers

The key idea of a std::atomic_thread_fence is, to establish synchronisation and ordering constraints between threads without an atomic operation.

Read more
Views: 71539

Acquire-Release Semantic - The typical Misunderstanding

A release operation synchronizes-with an acquire operation on the same atomic variable. So we can easily synchronise threads, if ... . Today's post is about the if.

Read more
Views: 21441

memory_order_consume

std::memory_order_consume is the most legendary of the six memory models. That's for two reasons. On one hand, std::memory_order_consume is extremely hard to get. On the other hand - that may change in the future - no compiler supports it.

Read more
Views: 20362

Acquire-Release Semantic

With the acquire-release semantic the memory model gets very thrilling. Because now, we have not to reason about the synchronisation of threads, now we have to reason about the synchronisation of the same atomic in different threads.

Read more
Views: 65489

Synchronization and Ordering Constraints

In this post, our tour through the c++ memory model goes one step deeper. Until now, the posts were only about the atomicity of the atomic data types but now we deal with the synchronisation and ordering constraints of the operations.

Read more
Views: 28185

My Newest E-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)

Blog archive

Source Code

Visitors

Today 930

Yesterday 5860

Week 930

Month 175640

All 7237930

Currently are 159 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments