3 ms·
Not really valid. In JS if a function blocks for 1 sec, the scheduler executes another function. The whole thread blocks for 1 sec only when all its async base
by vasilakisfil 7y ago
Not really valid. In JS if a function blocks for 1 sec, the scheduler executes another function. The whole thread blocks for 1 sec only when all its async based functions block.
The concurrency model is based on the event loop: https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop#Never_blocking https://developer.mozilla.org/en-US/docs/Web/JavaScript/Even...
- PopeDotNinja 7y agoNot all JavaScript code is async. If you write an infinite loop what takes a while, you'll lock up your entire JavaScript thread... let count = 0 ; while (count < 1000000000) { count += 1 } Counting from 1 to a billion will block any other operation from happening. In Elixir, that's not the case. Or am missing something?