Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do the JavaScript web APIs run on a different thread than the call stack thread?

Tags:

javascript

At 12:16 in the following video by Philip Roberts, he talks about the Web APIs and Node APIs running on different threads than the call stack, if I am understanding him correctly? So, is this correct, do the Web APIs and Node APIs run on different threads than the call stack and event loop?

If true, does this mean that they will run in parallel to JavaScript being executed in the call stack?

https://www.youtube.com/watch?v=8aGhZQkoFbQ

like image 629
Cazineer Avatar asked Jul 31 '26 14:07

Cazineer


1 Answers

Short Answer: Yes.

As has been pointed out in the comments, Web APIs "are effectively threads" although with a different behavior and purpose.

And, finally, the result will still be accessed and limited by the single "threadedness" of the JavaScript runtime when whichever callback is pushed into the Call Stack.

like image 98
Jonathan Soifer Avatar answered Aug 03 '26 04:08

Jonathan Soifer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!