Ben, thank you for your answer. That explains why some of my node apps use 
5 threads and others use just one (and later two, when express.js starts to 
server HTTP requests)

On Tuesday, November 27, 2012 5:36:12 AM UTC+1, Ben Noordhuis wrote:
>
> On Mon, Nov 26, 2012 at 9:17 PM, Stefan Happer 
> <[email protected]<javascript:>> 
> wrote: 
> > Sorry for maybe dumb question but why does "htop" show multiple threads 
> for 
> > node.js ? Isn't node.js single-threaded? 
> > 
> > This is on a 4-core server running Ubuntu 12.04 LTS 
>
> node.js is single-threaded insofar that JS code is executed from one 
> thread only.  Some operations however, notably file operations, are 
> handed off to a thread pool. 
>
> As to why, it's because of inherent limitations in today's popular 
> operating systems: none support true asynchronous file operations. 
>

-- 
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