美文网首页程序员让前端飞Web前端之路
每日科技英文47: 微软的多线程,多任务力作Napa.js库

每日科技英文47: 微软的多线程,多任务力作Napa.js库

作者: 随风而行之青衫磊落险峰行 | 来源:发表于2017-12-17 16:54 被阅读252次

今日要点:

  1. 微软napa.js让google v8 js引擎具有多线程多任务运行功能

  2. nodejs基于v8引擎,因此napa.js也可以适配到nodejs上

  3. napa.js核心代码都是使用c++11标准撰写,代码精心设计,编写优美,代码量不多不少,非常适合研究。如果你想学习如何使用c++11标准的新功能,那么napa.js是你的不二选择(本人就是从napa.js中学会了右值引用,以前一直对右值引用迷迷糊糊,不够清晰)

  4. napa.js实现了线程池,抽象了task系统。目前多线程,多任务比较好的参考实现,我个人认为是: libuv库napa.js库

  5. 好东西,就是要分享

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

附录:
napa.js github地址
napa.js用法

相关文章

网友评论

    本文标题:每日科技英文47: 微软的多线程,多任务力作Napa.js库

    本文链接:https://www.haomeiwen.com/subject/atxuwxtx.html