Skip to content

Remove unused (and unusable) emscripten_sync_run_in_main_thread API. #18580

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

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 23, 2023

This family of function was not used anywhere and is not currently usable externally.

The core function emscripten_sync_run_in_main_thread was not usable since the its first argument is em_queued_call which is not struct that is declared externally.

The emscripten_sync_run_in_main_thread_N function takes a function enum as arg0 which is not designed to be user facing.

It looks like these function were once used by JS library code but the last remaining use of them was removed in #16405.

See: #15756

This family of function was not used anywhere and is not currently
usable externally.

The core function `emscripten_sync_run_in_main_thread` was not usable
since the its first argument is `em_queued_call` which is not struct
that is declared externally.

The `emscripten_sync_run_in_main_thread_N` function takes a function
enum as arg0 which is not designed to be user facing.

It looks like these function were once used by JS library code but the
last remaining use of them was removed in #16405.

See: #15756
@sbc100 sbc100 force-pushed the remove_sync_run_in_main branch from 7dac524 to 9c9eff7 Compare January 23, 2023 17:17
@sbc100 sbc100 changed the title Remove unused and unusable emscripten_sync_run_in_main_thread API. Remove unused (and unusable) emscripten_sync_run_in_main_thread API. Jan 23, 2023
@sbc100 sbc100 requested review from kripken, tlively and juj January 23, 2023 17:17
@sbc100 sbc100 merged commit d62a2b9 into main Jan 23, 2023
@sbc100 sbc100 deleted the remove_sync_run_in_main branch January 23, 2023 20:08
@juj
Copy link
Collaborator

juj commented Jan 26, 2023

The core function emscripten_sync_run_in_main_thread was not usable since the its first argument is em_queued_call which is not struct that is declared externally.

It looks like the earlier refactor brought on a regression to make that function not usable? This PR now makes that regression a design? ( #15756 (comment) )

In the other thread, there was a question

I'm a big fan of making the public API as small a possible. Is there a specific use case that emscripten_sync_run_in_main_thread enabled?

The main feature that creating em_queued_calls manually provided was the ability to make callee-free proxied calls, i.e. ones that had satellite data associated with them. This is the mechanism that off-thread proxied WebGL would use. I agree this API was never really documented well enough, but the idea was to allow users to reuse the same system API that already existed, to avoid having them to duplicate the same kind of feature in their own code. Of course given that this was not documented beyond the header files, then it is likely that not many people used the feature.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 26, 2023

The core function emscripten_sync_run_in_main_thread was not usable since the its first argument is em_queued_call which is not struct that is declared externally.

It looks like the earlier refactor brought on a regression to make that function not usable? This PR now makes that regression a design? ( #15756 (comment) )

Basically yes.

In the other thread, there was a question

I'm a big fan of making the public API as small a possible. Is there a specific use case that emscripten_sync_run_in_main_thread enabled?

The main feature that creating em_queued_calls manually provided was the ability to make callee-free proxied calls, i.e. ones that had satellite data associated with them. This is the mechanism that off-thread proxied WebGL would use. I agree this API was never really documented well enough, but the idea was to allow users to reuse the same system API that already existed, to avoid having them to duplicate the same kind of feature in their own code. Of course given that this was not documented beyond the header files, then it is likely that not many people used the feature.

Yes, unless there is some user out there who hasn't upgraded in over a year I think we can be fairly sure there are zero such users.

@tlively does your new proxying API have some way to cover the above use case of "callee-free proxied calls"?

@tlively
Copy link
Member

tlively commented Jan 26, 2023

@tlively does your new proxying API have some way to cover the above use case of "callee-free proxied calls"?

The proxy queue API is fully general, but only in the sense that it allows you to pass arbitrary void* data around. For the sake of keeping things simple and well-layered, it doesn't directly support the managed satellite data or dynamic signature typing that em_queued_call supports.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 26, 2023

OK, well I propose that we leave this change in place and we can resurrect this a user facing API if/when there is a demand for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants