Let's look at the concept of concurrency using a simple example of a few daily routine tasks and the way we can perform them.
Imagine you start your day and need to get six things done:
- Make hotel reservation
- Book flight tickets
- Order a dress
- Pay credit card bills
- Write an email
- Listen to an audiobook
The order in which they are completed doesn't matter, and for some of the tasks, such as writing an email or listening to an audiobook, you need not complete them in a single sitting. Here is one possible way to complete the tasks:
- Order a dress.
- Write one-third of the email.
- Make hotel reservation.
- Listen to 10 minutes of audiobook.
- Pay credit card bills.
- Write another one-third of the email.
- Book flight tickets.
- Listen to another ...