4 ms·
With regards to the 'connections to the OS', I was attempting to paraphrase this chunk from the official site: "Node's goal is to provide an easy way to build
by kmccarth 16y ago
With regards to the 'connections to the OS', I was attempting to paraphrase this chunk from the official site:
"Node's goal is to provide an easy way to build scalable network programs. In the "hello world" web server example above, many client connections can be handled concurrently. Node tells the operating system (through epoll, kqueue, /dev/poll, or select) that it should be notified when a new connection is made, and then it goes to sleep. If someone new connects, then it executes the callback. Each connection is only a small heap allocation.
This is in contrast to today's more common concurrency model where OS threads are employed. Thread-based networking is relatively inefficient and very difficult to use. See: this and this."
- axod 16y agoPretty much any webserver can do that though. Even apache can easily be setup to do that. So it's not really unique to node.js. Definitely a good design decision, but as I say, not unique to node.js.