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 and then need to create four child windows. For each window, we will create a separate thread with no constraints on system resources—in our example, a brush for painting each window respectively. Later, in our next example, we will assume that...