emscripten-core / emscripten-core/emscripten
Support the building of an executable which has optional multithreading if `SharedArrayBuffer` is available
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
For [`magickwand.js`](https://magickwand.js.org/) I would like to be able to ship an universal binary that uses multithreading and has `xxxAsync` methods available when `SharedArrayBuffer` is available but which can be loaded without `SharedArrayBuffer` - async methods will throw in this case.
This will leave the user the option to implement multithreading himself - by creating web workers and passing messages - eventually using a framework such as [`comlink`](https://www.npmjs.com/package/comlink).
As this will require significant changes, I would like to discuss it before starting the implementation.
Contributor guide
Assessment
This issue has not been assessed yet.