3 ms·
Right. Whether it's the browser's XMLHttpRequest or localStorage or NodeJS's readFileSync JS can block on I/O. But since the language is single-threaded (or at
by paulddraper 10y ago
Right. Whether it's the browser's XMLHttpRequest or localStorage or NodeJS's readFileSync JS can block on I/O.
But since the language is single-threaded (or at least, it defines nothing about multiple threads with shared memory), there is a strong incentive not to have blocking functions.
- jayflux 10y agoSynchronous mode for xmlhttprequest has been deprecated now for some time (at least in FF anyway)
- paulddraper 10y agoSure. But it exists/existed. No magic says that everything in JS has to be non-blocking.