September 2019
Intermediate to advanced
816 pages
18h 47m
English
In order to show how a thread pool with a single thread works, let's assume that we want to write a program that simulates an assembly line (or a conveyor) for checking and packing up bulbs using two workers.
By checking, we understand that the worker tests if the bulb lights up or not. By packing, we understand that the worker takes the verified bulb and put it in a box. This kind of process is very common in almost any factory.
The two workers are as follows:
This kind of problem is a perfect fit ...