emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

Restructuring emscripten_dlopen_js

Open impact-maker opened this issue 1 year ago • 4 comments

Solves #21440
emscripten_dlopen_js

Description:

Promise-Based Approach as the cannonical approach: Anchoring asynchronous operations within a Promise object, giving a method to manage asynchronous tasks

Callback Support: Maintains backward compatibility with callback functions (onsuccess, onerror)

ASYNCIFY Integration: Bridges synchronous C/C++ code with asynchronous JavaScript operations by compiling the WebAssembly module with ASYNCIFY enabled and specifying asynchronous functions like _emscripten_dlopen_js in ASYNCIFY_IMPORTS

impact-maker avatar Mar 22 '24 13:03 impact-maker

@sbc100 @tlively I have made an initial api restructuring draft for emscripten_dlopen_js async function. Kindly provide feedback on this implementation

impact-maker avatar Mar 22 '24 13:03 impact-maker

@tlively @sbc100 I have done the whole setup for test suite and pushed the code. But after running the test , it is getting stuck test/runner core0.test_pthread_dlopen_many Test suites: ['test_core'] Running test_core: (1 tests) (checking sanity from test runner) shared:INFO: (Emscripten: Running sanity checks) test_pthread_dlopen_many (test_core.core0.test_pthread_dlopen_many) ...

impact-maker avatar Mar 29 '24 19:03 impact-maker

If you add --verbose to the runner command, it should print out the commands it's using to build and run the test case. You can then run those commands yourself to debug the code.

tlively avatar Mar 29 '24 19:03 tlively

@tlively @sbc100 @kripken I have made a revision in dlopen api which inverts the callback functionality to use promises as the main form and implementating callbacks and asyncify around it. Can you provide me feedback on this so that I can take it ahead from here.

impact-maker avatar Apr 15 '24 17:04 impact-maker