You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume the work in silk_encode is something takes some amount of time and you don't want to have the main thread block while its running? IIUC that only way run such work in the background would be do so on a thread.
Then you probably want to have silk_encode return a promise which the encode function calls await on. The C++ code can/should then resolve the promise once that background thread is done processing. Note that promises and embind values all live on a specific thread, so you would likely need to do the promise resolution back on the back thread.
I assume the work in silk_encode is something takes some amount of time and you don't want to have the main thread block while its running? IIUC that only way run such work in the background would be do so on a thread.
Then you probably want to have silk_encode return a promise which the encode function calls await on. The C++ code can/should then resolve the promise once that background thread is done processing. Note that promises and embind values all live on a specific thread, so you would likely need to do the promise resolution back on the back thread.
Version of emscripten/emsdk:
link command:
C++ code:
Typescript code:
When I run the
encodefunction in the Typescript code, the JS thread is blocked. How can I solve this?The text was updated successfully, but these errors were encountered: