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

Multithreaded: Summation with Minimal Synchronization

Until now, I've used two strategies to summate 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 that the thread will perform their summation as independently from each other as possible and therefore reduce the synchronization overhead. 

Read more
Views: 23897

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

Ongoing Optimization: Sequential Consistency with CppMem

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

Read more
Views: 14965

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

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

Sequential Consistency applied

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

Read more
Views: 23334

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

Atomics

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

Read more
Views: 69930

The Atomic Flag

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

Read more
Views: 64469

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 1536

Yesterday 6503

Week 27793

Month 8039

All 12086248

Currently are 262 guests and no members online

Kubik-Rubik Joomla! Extensions

Latest comments