3 ms·
Except for webworkers (relatively new, I've not used them and know little about them), javascript in browsers is single-threaded. Even asynchronous things like
by Izkata 7y ago
Except for webworkers (relatively new, I've not used them and know little about them), javascript in browsers is single-threaded. Even asynchronous things like ajax requests can only handle the result once the thread finishes doing whatever it was doing.
- 7thaccount 7y agoInteresting and thanks for the explanation. Does it have to be single threaded?
- ProfHewitt 7y agoJavaScript in browsers was decreed by the standards committee to be single-threaded forever. Consequently, JavaScript is entirely lacking in concurrency constructs, e.g., implementing a region of mutual exclusion inside a JavaScript program.
- 7thaccount 7y agoThanks! I assume that was for a reason? Or just oversight?