-
Notifications
You must be signed in to change notification settings - Fork 47
Implementing mapping in multithreaded WASM #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also possibly relevant: spontaneous-mode MapAsync (in the Futures version of the API, #199) will complete mappings on arbitrary threads in native. For example, it could happen inside an innocuous Submit from an application thread. Unless we check which thread we're running on and prevent this from happening. |
Mar 28 meeting:
|
Closing (but with "needs docs") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've given this problem a lot of thought but I can't find a filed issue about it, so here's a quick note.
In native, threads freely do things with whatever objects they want (gpuweb/gpuweb#476) and that includes mapping and unmapping buffers.
However in JS, a buffer can only be unmapped from the thread where it's mapped, and ArrayBuffers for the mapping only exist on that thread. However since there is currently no way to map that ArrayBuffer into the WASM heap, Emscripten just mallocs WASM heap memory for the map, and copies to/from it as needed.
Possible ways to resolve this:
The text was updated successfully, but these errors were encountered: