3 ms·
node.js isn't single-threaded. The JS code gets executed in a single thread, but I/O happens in multiple threads (that stuff is all abstracted away by libuv, bu
by rmrfrmrf 9y ago
node.js isn't single-threaded. The JS code gets executed in a single thread, but I/O happens in multiple threads (that stuff is all abstracted away by libuv, but I still consider libuv to be an integral part of node.js).
- kbutler 9y agoPython I/O also releases the GIL (and has for decades). And FWIW, libuv is also available in Python. https://magic.io/blog/uvloop-blazing-fast-python-networking/ https://magic.io/blog/uvloop-blazing-fast-python-networking/ claims significantly faster than nodejs.
- rmrfrmrf 9y ago> Python I/O also releases the GIL (and has for decades). I didn't know this; thanks! I'm not familiar with Python internals at all (in fact, I had to look up what GIL was when I read the article). Seems strange, then, that the author would imply a contrast between Python and node.js (which I'm now realizing was your point to begin with). Thanks for being patient with me :). > And FWIW, libuv is also available in Python. > https://magic.io/blog/uvloop-blazing-fast-python-networking/ https://magic.io/blog/uvloop-blazing-fast-python-networking/ claims significantly faster than nodejs. Yep! There are bindings for quite a few languages now. The only reasons why I conflate libuv with node.js are because libuv was developed specifically for node (as a cross-platform libev implementation) and because libuv comes with node by default.