|
|
|
|
|
by henryw
3713 days ago
|
|
From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Even...: JavaScript has a concurrency model based on an "event loop". This model is quite different than the model in other languages like C or Java. ... A very interesting property of the event loop model is that JavaScript, unlike a lot of other languages, never blocks. Handling I/O is typically performed via events and callbacks, so when the application is waiting for an IndexedDB query to return or an XHR request to return, it can still process other things like user input. |
|
I think that's a little strong. It's more like "The group controlling Javascript has mostly tried to discourage introduction of things that block".
You can, for example, do a blocking XMLHttpRequest. It's deprecated, but possible. https://jsfiddle.net/923d5sda/