What is technical the difference between a thread and an async-operation?

926 views

I assume that two threads are working on a single cpu like this:

| Thread1 | Thread2 |
|———|———|
| a1 | b1 |
| a2 | b2 |
| a3 | b3 |

And are batched like this on the CPU

a1-b1-a2-b2-a3-b3

In: Technology

4 Answers

Anonymous 0 Comments

Here is an analogy that might help.

Lets say you’re busy but you need to drop your car to the garage for a service then pick it up later.

You could delegate this to someone else: they bring your car to the garage, sit around until its fixed and drop it back. The upside is you can work away as normal. The downside is you need to find someone else, and they’re wasting their time waiting for your car to be fixed.

Or you could try to find 10 spare minutes in the morning to drop it down, and 10 minutes in the afternoon to collect it. The downside is its 20 minutes out of your day, and more work coordinating your time. The upside is you can do it all yourself and nobody is waiting around.

The first is kind of like a thread, the second is kind of like an async task.

You are viewing 1 out of 4 answers, click here to view all answers.