JXCore brings multithreading, sort of, to Node.js

Node.js fork JXCore adds multithreaded core to JavaScript server-side app engine, but may alienate open source users

Node.js's open source nature and highly liberal MIT licensing -- same as the V8 JavaScript engine at the heart of Node.js -- invites all manner of reuse and rework. Among the latest wrinkles is a still-in-beta fork of Node.js, JXCore, that allows Node.js apps to run on multiple threads housed within the same process.

While Node.js itself is multithreaded -- I/O and other such operations run from a thread pool -- JavaScript code executed by Node.js runs, for all practical purposes, in a single thread. This isn't a limitation of Node.js itself, but of the V8 JavaScript engine and of JavaScript implementations generally. JXCore, by contrast, operates JavaScript code in threads that run side-by-side in a pool and have incoming requests dispatched to them.

The creators of JXCore claim that their fork of Node.js can work as a drop-in replacement for the standard Node.js server and boosts the responsiveness of Node.js applications under heavy loads. The benchmarks they ran not only included the stock Node.js distribution, but also Vert.x, the application platform used by Nodyn.

Node.js includes a native mechanism for clustering multiple Node.js processes, where each process runs on a separate core. But that clustering mechanism doesn't include any native routing logic or shared state between workers, so JXCore tries to address these problems by providing a thread-safe "Memory Store." JXCore also provides two basic ways to run Node.js apps: via a simple command-line instruction, where threads are managed more or less automatically, or by using JXCore's native task API.

JXCore also features memory management. Its creators claim each subthread has its own allotment of V8 heap space, so only each individual thread, not the process as a whole, would have any memory limits. That said, the Node.js API has its own mitigations for in-process memory limits -- that is, buffers -- and many of the old memory limits in V8 that caused headaches for early Node.js adopters have since been addressed.

One major stumbling block for JXCore, at least as far as die-hard open source fans go, is that it isn't itself open source. It's a closed source fork, made possible via Node.js's MIT license, which allows reuse of the source code even in a commercial product with no redistribution of the source. This makes JXCore more appealing to those simply looking to deploy Node.js apps and aren't as motivated by Node.js itself being open source (as opposed to the frameworks built with it).

This story, "JXCore brings multithreading, sort of, to Node.js," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Mobile Security Insider: iOS vs. Android vs. BlackBerry vs. Windows Phone
Recommended
Join the discussion
Be the first to comment on this article. Our Commenting Policies