今日要点:
-
微软napa.js让google v8 js引擎具有多线程多任务运行功能
-
nodejs基于v8引擎,因此napa.js也可以适配到nodejs上
-
napa.js核心代码都是使用c++11标准撰写,代码精心设计,编写优美,代码量不多不少,非常适合研究。如果你想学习如何使用c++11标准的新功能,那么napa.js是你的不二选择(本人就是从napa.js中学会了右值引用,以前一直对右值引用迷迷糊糊,不够清晰)
-
napa.js实现了线程池,抽象了task系统。目前多线程,多任务比较好的参考实现,我个人认为是: libuv库和napa.js库。
-
好东西,就是要分享
Naps.js是什么?
Napa.js is a multi-threaded JavaScript runtime built on V8, which was originally designed to develop highly iterative services with non-compromised performance in Bing.
As it evolves, we find it useful to complement Node.js in CPU-bound tasks, with the capability of executing JavaScript in multiple V8 isolates and communicating between them.
Napa.js is exposed as a Node.js module, while it can also be embedded in a host process without Node.js dependency.
Features
- Multi-threaded JavaScript runtime
- Node.js compatible module architecture with NPM support
- API for object transportation, object sharing and synchronization across JavaScript threads
- API for pluggable logging, metric and memory allocator
- Distributed as a Node.js module, as well as supporting embed scenarios
网友评论