On 26/06/2012, at 02:43, GuoQing Deng wrote:

> Free Node.js eBook update: http://www.heronote.com/files/Node.js.htm 


> "Furthermore, users of Node are free from worries of dead-locking the 
> process—there are no locks."

Neither in a bunch of httpd processes.

> "But what about multiple-processor concurrency? Aren't threads necessary to 
> scale programs to multi-core computers?"

-YES: Threads are necessary to scale programs to multi-core computers.

> "Processes are necessary to scale to multi-core computers"

-Processes *are* threads.

> "not memory-sharing threads."

-Processes *are* threads running in isolated memory spaces, and it's so for 
security reasons *not* for performance reasons.
-The ability to share memory is always a plus.
-The threads in a process share what they want to share and if they want to. 
They can also share nothing as processes do.

> "The fundamentals of scalable systems are fast networking and non-blocking 
> design—"

-But node uses multiple threads itself both to *parallelize* IO and to avoid 
blocking on IO. But it doesn't expose any threads API to its users.

> "the rest is message passing."

-There's no fastest way to pass a message than via a pointer and you can't do 
that across processes but you can do it across threads.

> "In future versions, Node will be able to fork new processes (using the Web 
> Workers API ) which fits well into the current design."

-In other words, to exploit multiple cores node will do just what everybody 
else has been doing until now, say, httpd: fork itself.


threads_a_gogo(*) gives node users the power to parallelize the execution of 
their javascript code within a single node process. Node couldn't benefit 
before threads_a_gogo of multi-core cpus simply because it was lacking a 
threads API. But threads_a_gogo gives you one:

(*) <https://github.com/xk/node-threads-a-gogo/>
-- 
Jorge.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to