sequential consistency

My Conclusion: Summation of a Vector in three Variants

After I've calculated in three different ways the sum of a std::vector I want to draw my conclusions.

Read more
Views: 11665

Multithreaded: Summation with Minimal Synchronization

Until now I've used two strategies for the summation of a std::vector. First I did the whole math in one thread (Single Threaded: Summation of a vector); second multiple threads shared the same variable for the result (Multithreaded: Summation of a vector). In particular the second strategy was extremely naive. In this post I will apply my knowledge of both posts. My goal is it that the thread will perform their summation as independent form each other as possible and therefore reduce the synchronization overhead. 

Read more
Views: 13803

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

Ongoing Optimization: Sequential Consistency with CppMem

With atomic data types you can tailor your program to your needs and therefore optimize it. But now we are in the domain of the multithreading experts.

Read more
Views: 9158

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

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

Sequential Consistency applied

I have introduced In the post Sequential Consistency the default memory model. This model, in which all operations in all threads takes place in a global time clock, has a big advantage but also a big disadvantage.

Read more
Views: 14043

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

Atomics

In addition to booleans, there are atomics for pointers, integrals and user defined types. The rules for user-defined types are special.

Read more
Views: 43471

The Atomic Flag

Atomics guarantee two characteristics. At one hand, they are atomic, at the other hand, they provide synchronisation and order constraints on the program execution.

Read more
Views: 39282

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

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 1202

Yesterday 7707

Week 24330

Month 229377

All 4850271

Currently are 187 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments