Concurrency in a nutshell
Concurrency can be applied in a variety of ways. Usually, the motivation behind concurrency is to run more than one task simultaneously in order to get work done faster. As we discussed at the beginning of this book, concurrency can also help our code resemble the real world more, where multiple activities occur at the same time.
First, let's cover some fundamental concepts behind concurrency.
One common application of concurrency is to run different tasks simultaneously. Imagine that you have three chores: mow the lawn, trim the trees, and pull the weeds. If you do these three chores by yourself, you can only do one chore at a time. You cannot mow the lawn and trim the trees simultaneously. You have to sequentially ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access