-
Notifications
You must be signed in to change notification settings - Fork 16
Lite Thread Worker
We want to share data or code which is not tied to thread context between those threads to keep worker thread lightweight.
We propose this project to achieve our goals and implement it as soon as possible, so maybe it seems like a prototype.
We have fixed most of the bugs and it works well in our system currently.
There are some differences between the code here and the code we use in our system.
We haven't merge node snapshot to lite thread worker here, which will speed up the boot of the thread worker.
Additional details in Thread Worker in Node.js
OS: linux-64bit (We will support macOS later)
Arch: x64, arm (We will support x86 and arm64 later)
git clone https://github.com/alibaba/AliOS-nodejs.git
git checkout --track origin/dev_lite_thread_worker
gcc: 4.9 or higher
./configure --dest-cpu=x64
make -j n
or make
We use the api which is almost the same with Web Worker API.
We just use "ThreadWorker" instead of "Worker" currently because we haven't found a proper name.
You can find basic usage here: test/thread-worker
Additional details in API.
python tools/test.py --mode=release thread-worker
We implement worker in d8 and it has a fake message loop there.
cd deps/v8
make x64.release.check