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

Thread-Safe Initialization of a Singleton

There are a lot of issues with the singleton pattern. I'm aware of that. But the singleton pattern is an ideal use case for a variable, which can only 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 use cases for the thread-safe initialization of a variable.

Read more
Views: 365474

Ongoing Optimization: A Data Race with CppMem

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

Read more
Views: 12768

Ongoing Optimization: Acquire-Release Semantic with CppMem

With the acquire-release semantics, we break the sequential consistency. In the acquire-release semantics, synchronization occurs between atomic operations on the same atomic and not between threads.

Read more
Views: 14432

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

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

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

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

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

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

Stay Informed about my Mentoring

 

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

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

Course: Master Software Design Patterns and Architecture in C++

Subscribe to the newsletter (+ pdf bundle)

All tags

Blog archive

Source Code

Visitors

Today 1980

Yesterday 4344

Week 38858

Month 19104

All 12097313

Currently are 164 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments