Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not familiar with node.js. What engine is used to run the stand-alone JS? Is it inevitable that is it limited to a single core?


Node uses Google's V8 virtual machine, which they built for Chrome. JavaScript is single-threaded, so yes, unless you spawn a child process it'll be limited to a single core.


Is being single-threaded part of the JavaScript spec?


Only implicitly: no threading model is documented in the ECMAScript Language Specification [1], and no widely-used interpreter implements threading. The new Web Workers specification adds something like threading to JavaScript in the context of the browser [2], and Node intends to add support for this on the server as well [3]. Have a look at [4] for a nice article on threading in JavaScript.

[1] http://www.ecma-international.org/publications/files/ECMA-ST...

[2] http://www.whatwg.org/specs/web-workers/current-work/

[3] http://nodejs.org/

[4] http://odetocode.com/blogs/scott/archive/2007/01/08/javascri...


It uses Google's open source V8 JavaScript engine. (http://code.google.com/p/v8/) It doesn't support multiple cores AFAIK. To use multiple cores, the server would need to spawn subprocesses or run multiple servers behind nginx.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: