+ 2
thread simulation in javascript
javascript is a single-threaded language, all instructions are processed in the same thread, if things like an infinite "while" occur, the entire process is blocked. Is there a way to create or simulate two threads so that if one crashes the other will still work?
2 Answers
0
Unfortunately, you cannot. Javascript is completely single threaded. Even when running certain commands on the web, if you go into the Developer Tools and put in some kind of infinite loop, it will cause the rest of the webpage's functions to stop.