C++ Core Guidelines: Be Aware of the Traps of Condition Variables

Today, I write a scary post about condition variables. You should be aware of this issues of condition variables. The C++ core guideline CP 42 just states: "Don't wait without a condition".

Read more
Comments 2Views: 3075

C++ Core Guidelines: More Traps in the Concurrency

Concurrency provides many ways to shoot yourself in the foot. The rules for today help you to know these dangers and to overcome them.

Read more
Add CommentViews: 1735

C++ Core Guidelines: Taking Care of your Child Thread

When you create a new child thread, you have to answer an important question: should you wait for the child or detach yourself from it? If you detach yourself from the newly created child, and your child uses variables which are bound to your lifetime as creator a new question arises: Will the variables stay valid during the lifetime of the child thread?

Read more
Add CommentViews: 1599

C++ Core Guidelines: Sharing Data between Threads

If you want to have fun with threads, you should share mutable data between them. In order to get no data race and, therefore, undefined behaviour, you have to think about the synchronisation of your threads.

Read more
Add CommentViews: 2691

C++ Core Guidelines: Use Tools to Validate your Concurrent Code

Today, I'm happy to write about the probably most important rule of the C++ Core Guidelines for concurrency: Whenever feasible use tools to validate your concurrent code. Not all, but a lot of bugs can be detected with tools and each fixed bug is a good bug. Here are two tools which provided me precious help in the last years: ThreadSanitizer and CppMem.

Read more
Add CommentViews: 2782

C++ Core Guidelines: More Rules to Concurrency and Parallelism

Writing multithreading programs is hard, even harder if the program should be correct. The rules of the C++ Core Guidelines guide you to write correct programs. The rules of this post will deal with data races, sharing of data, tasks, and the infamous keyword volatile.

Read more
Add CommentViews: 9421

C++ Core Guidelines: Rules for Concurrency and Parallelism

C++11 is the first C++ standard that deals with concurrency. The basic building block for concurrency is a thread; therefore, most of the rules are explicitly about threads. This changed dramatically with C++17.

 

Read more
Add CommentViews: 4019

My Newest E-Books

Latest comments

Subscribe to the newsletter (+ pdf bundle)

Blog archive

Source Code

Visitors

Today 432

All 897179

Currently are 208 guests and no members online

Kubik-Rubik Joomla! Extensions