O'Reilly logo

Distributed Computing with Go by V.N. Nikhil Anurag

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Concurrency

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:

  1. Order a dress.
  2. Write one-third of the email.
  3. Make hotel reservation.
  4. Listen to 10 minutes of audiobook.
  5. Pay credit card bills.
  6. Write another one-third of the email.
  7. Book flight tickets.
  8. Listen to another ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required