4 ms·
>> we were able to allow UNIX-like threading to run via JS Workers by reusing the shared memory from the main WebAssembly process and notifying the memory upon
by noduerme 3y ago
>> we were able to allow UNIX-like threading to run via JS Workers by reusing the shared memory from the main WebAssembly process and notifying the memory upon changes (using Wasm notify/wait syntax).
This left me scratching my head. How are JS workers sharing memory with the WASM process?
- kevingadd 3y agoJS has an API called "SharedArrayBuffer" that allows sharing memory between processes or threads (with the aid of the host)
- temp123789246 3y agoI wonder how much of a perf hit a normal multithreaded Unix application would take because of this model. Are there any data points around the multi-threading perf here?
- chatmasta 3y agoI believe JS workers are actually implemented as threads, so the performance overhead might not be as bad as you'd expect.
- syrusakbary 3y agoUsually it adds an extra 10-25% of overhead when the WASIX program uses systemcalls that require unwind/rewind functionality (this is for fork and subprocesses mainly, the multithreaded ones doesn't require asyncify and as such should not experience a performance hit)