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

Read more
Views: 66999

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

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

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

Acquire-Release Fences

Acquire and release fences guarantee similar synchronization and ordering constraints as atomics with acquire-release semantics. Similar because the differences are in the details.

Read more
Views: 44096

Fences are Memory Barriers

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

Read more
Views: 88256

Acquire-Release Semantics - 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: 26868

memory_order_consume

std::memory_order_consume is the most legendary of the six memory models. That's for two reasons. On the 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: 26330

Acquire-Release Semantic

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

Read more
Views: 76662

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 synchronization and ordering constraints of the operations.

Read more
Views: 35274

Mentoring

Stay Informed about my 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

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

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code

Visitors

Today 737

Yesterday 6519

Week 37299

Month 181470

All 11662624

Currently are 138 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments