Implementing threads without synchronization

In a lot of situations, parallel tasks need to occur without depending on each other. Such situations could happen in an application with more user-interface dialogs. For example, on a primary application window, there is a list view with customers shown. On another application window (or application tab), there is a list view with products shown. When we start such an application, it would be foolish to load the customers first and then the products. We can start two threads, each responsible for loading the object from the database (the first thread would load the customers, and the other one would load the products).

Now, let's review a simple example. We have to initialize the main application window ...

Get C++ Multithreading Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.