Understanding parallelism
Although the words concurrency and parallelism are used interchangeably in the general sense, they differ slightly when it comes to the world of computers. Both of them are used to speed up things. However, concurrency focuses on multiple independent tasks to be finished in the least possible time. In contrast to concurrency, parallelism focuses on splitting one single task into multiple resources to speed up finishing a particular job. The concept of parallelism is huge, and it could take a full chapter to explain it. For this chapter, we will keep things simple and concise in this section and try to understand a use case of parallelism by looking at a simple but intuitive real-world example.
Consider that you have a tank with a capacity of 1,000 liters where you store water to use for your farmland. You have an electrical motor pump that pulls water up from the ground and fills the tank at a rate of 10 liters per minute. To fill the empty tank using a...