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.
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!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.
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!