-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Never run callbacks synchronously in emscripten_dlopen #24481
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
base: main
Are you sure you want to change the base?
Conversation
Having sometimes-syncrinous callbacks is a bad idea, and it was actually causing real issues with the emscripten_dlopen_promice API. See emscripten-core#24461 and pyodide/pyodide#5610 (comment)
This change adds a new `emscripten_queue_microtask` API to match the long standing web API (also available in node). See https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask For now, I'm adding this without a polyfill so usage of the API will crash on very old targets. We could potentially polyfill using something like setTimeout, but the semantics are a little different so I'm not sure it worth doing. Split out from emscripten-core#24481
This change adds a new `emscripten_queue_microtask` API to match the long standing web API (also available in node). See https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask For now, I'm adding this without a polyfill so usage of the API will crash on very old targets. We could potentially polyfill using something like setTimeout, but the semantics are a little different so I'm not sure it worth doing. Split out from emscripten-core#24481
Thanks for fixing this! I tested this patch in my Pyodide PR that use
Interestingly, adding Full cmdline was
|
Likely the sysroot would need updating to get the header file. You can use |
Having sometimes-syncrinous callbacks is a bad idea, and it was actually causing real issues with the emscripten_dlopen_promice API.
This introduced a new
emscripten_queue_microtask
API to match the long standing web API (also available in node).See https://developer.mozilla.org/en-US/docs/Web/API/Window/queueMicrotask
See #24461 and pyodide/pyodide#5610 (comment)