O'Reilly logo

C++ Multithreading Cookbook by Milos Ljumovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to design parallel applications

In order to prevent problematic situations, we need to first identify the possible scenarios. We can divide problems related to concurrency into two major categories:

  • Correctness problems: These can cause a program to produce incorrect results
  • Liveness problems: These can cause a program to stop producing results completely

Correctness problems are very hard to discover because of the nature of the concurrency itself. Since each thread takes a different execution path, these situations can occur at any point of time without the programmer realizing that the program's output is incorrect, and something went wrong. In the worst case, we can run such a program many times with the correct results before a scenario ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required