UPDATED 18:02 EDT / MARCH 12 2014

JXcore: The V8 engine supported multithreading programming language

nodejs-logoWith the V8 JIT compiler, Node.js can interpret scripts in JavaScript and is protocol-independent, can use HTTP to serve HTML pages or other protocols for other types of applications. In other words, Node.js supports multi-threading. With all these advantages, a number of companies migrated their websites to Node.js stack with substantial results. A recent example is Groupon, which recently completed a year-long project to migrate from Ruby on Rail to node.js stack or Microsoft adoption of node.js to its Visual Studio integrated development platform.

But one disadvantage of using Node.js and V8 is it uses just one context, this is because JavaScript ends up running everything in the same thread. As a result, JXcore multithreading is not the same as running multiple threads with JavaScript; instead it creates a V8 thread pool and issues tasks across that pool. In turn each of these threads return their data to the main thread in proper order to protect the main thread from corruption. In the end, this library provides multi-core capability to what otherwise wouldn’t be.

Node.js development thread safety development remains essentially the same.

JXcore – Node.js distribution with multi-threading

In such situations, a robust approach is to let Node fail, restart fast, and have clean state. JXcore allows you to run x number of tasks in parallel depending upon the number of CPUs. JXcore is a fork on Node.JS 0.12 which is compatible with Node.JS v0.12 and also with all the projects and modules around it.

The programming language goal is to support multiple (isolated) instances running on the same process without limiting capabilities of the framework since Google’s V8 engine already supports multiple and concurrent isolates. Every single isolate has its own heap memory and garbage collection.

JXcore official page says multiple isolates make JXcore more responsive and capable of handling expensive operations comparing to multi process models because of not having cross process communication and synchronization. Besides the performance gain, it also helps reaching beyond V8’s memory limitation. Every single thread has its own ‘separate’ heap memory space.

JXcore Node.js is a derivative of the project, the same process used in multiple isolated instances. Any single-threaded applications will benefit from the multi-threaded core, but without any changes to the code. JXCore support cluster contains a message API, support android, iOS and Windows and browser clients.

How it works

Using the new multithreaded tasks API, JXcore creates a V8 thread pool and issues your tasks separately on different threads. Each thread sends the results to the main thread in the same order as they got query without compromising the thread safety of the main thread. This result in customizing the multithreading feature and scaling up the application as per your own usage.

JXcore features memory management where each subthread has its own allotment of V8 heap space. It results in small memory footprint compared to Node Cluster. You can still run multiple node process but two threads per each. This will improve the responsiveness of each process by balancing the load exactly on the native side. That means, if anything happens on one of the V8 threads, the other one will be handling the load.

JXcore team has embedded most popular C, C++ modules internally and soon will release a new beta with automated process monitoring and NGINX proxy deployment. The team is working on replacing Google V8 engine with native LLVM compilation. JXcore with LLVM will enable JavaScript programmers to develop desktop applications as well as cross platform native mobile and embedded apps. The team is also working on trouble free database modules, faster I/O, extending the internal module for better cross platform support including UI and system API and lots of other security features.

The latest release of JXcore Beta-1X02 can be downloaded from here. The latest Beta2 added support for SUSE_ia32, Red Hat, and Win64X, JX package installer, up to 60% faster response times and faster execution on MT compared to Beta-1 and several bug fixes and stability updates.


A message from John Furrier, co-founder of SiliconANGLE:

Your vote of support is important to us and it helps us keep the content FREE.

One click below supports our mission to provide free, deep, and relevant content.  

Join our community on YouTube

Join the community that includes more than 15,000 #CubeAlumni experts, including Amazon.com CEO Andy Jassy, Dell Technologies founder and CEO Michael Dell, Intel CEO Pat Gelsinger, and many more luminaries and experts.

“TheCUBE is an important partner to the industry. You guys really are a part of our events and we really appreciate you coming and I know people appreciate the content you create as well” – Andy Jassy

THANK YOU