In this section, we're focusing on concurrent.futures, the more abstract and easier to use of the two packages mentioned earlier. Our focus will be on the four main operations in concurrent.futures. We will then move on to the usage of future objects and end with the implications of the mechanism of data transfer between processes.
Some programs are what we call CPU-bound, which means that the primary factor which determines how long the program takes to complete its tasks is how fast the computer can run through its instructions. Interestingly, most programs that we use on a daily basis are not CPU-bound. However, for those that are, we can often speed them up by breaking them into separate processes.
This difference can be illustrated as follows:
In the preceding figure, on the left-hand side, we have a CPU-bound program. It has many...