2016-06-02
['faɪbɚ]
A fiber is a unit of execution that must be manually scheduled by the application. Fibers run in the context of the threads that schedule them. Each thread can schedule multiple fibers. In general, fibers do not provide advantages over a well-designed multithreaded application. However, using fibers can make it easier to port applications that were designed to schedule their own threads.
fibjs 是一个建立在 Google v8 Javascript 引擎基础上的应用服务器开发框架,不同于 node.js,fibjs 采用 fiber 解决 v8 引擎的多路复用,并通过大量 c++ 组件,将重负荷运算委托给后台线程,释放 v8 线程,争取更大的并发时间。
C10K
V8 (Javascript) 工作线程池 异步 IO
var coroutine = require("coroutine");
function func(){
coroutine.parallel(function(){
...
}, function(){
...
}, function(){
...
}, function(){
...
});
}
2016-06-02