DEV Community

Discussion on: I Promise this is a practical guide to Async / Await

Collapse
 
nestedsoftware profile image
Nested Software

This code is truly parallel.

All of the code you've shown is running either concurrently (allowing other code to run while waiting for I/O) or sequentially (one after the other).

The term parallel refers to code that is running at the same time. If you have two pieces of code running in parallel, it means both are running simultaneously on two different CPUs or CPU cores.

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

You are correct.
The example maybe I chose is not the best.

I should explain it better.

It is of course not parallel on the CPU level.
For that, you need web workers.

What I meant there is that if you call for example 2 API calls they can be called in parallel. You don't need to wait for one to finish to call another one.

Thanks for making that clear! Good job!

Have a nice day!