-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
FinalizationRegistry.prototype.cleanupSome integration with HTML #5446
Comments
Worker threads is a tad too vague, should this follow an agent's [[CanBlock]]? |
When we discussed this previously, it wasn't clear whether it should always match [[CanBlock]], or maybe it should be a separate bit. I don't really have enough background here to know; for example, I don't know whether we might want to make cleanupSome available to Worklets. |
Whenever we set [[CanBlock]] to false in the web platform the reason is that the agent runs performance-critical code (e.g., a worklet might be responsible for audio processing). As I understand it |
I see no technical reason to disable (I should note that Apple's contention seems to be all about the kind of programs that are encouraged, regardless of [[CanBlock]] and any main-thread-off-thread distinction.) |
To be clear, I'd consider expensive operations to be effectively blocking and not desirable on web platform [[CanBlock]] is false agents. It means you might end up skipping a frame, not encode some audio in time, not process requests in a timely manner, etc. |
I don't know what's expensive/blocking about |
This is also my understanding of where TC39 ended up. In the TC39 discussion, Apple's position was "no, we should discourage this coding style". Firefox's position was "yes, we should allow this coding style for wasm". Chrome's position was "yes, we should allow this coding style for wasm in workers". Please correct me @codehag and @kmiller68 for any misrepresentations above. |
Gated on #4571.
WeakRefs is a TC39 proposal currently at Stage 3 and may ship soon in Chrome.
In the April 2020 TC39, Apple expressed desire to remove
FinalizationRegistry.prototype.cleanupSome
. There was no consensus in TC39 for its removal. Instead, TC39 made that method normative optional (i.e. up to hosts to ship, and how) to unblock the rest of the proposal.Crucially, this means that it's up to HTML spec for if and how to ship
FinalizationRegistry.prototype.cleanupSome
. The thread above has Apple's objections and Mozilla and others' counter-objections.I'd like to propose one of the original proposals that Apple rejected: ship
cleanupSome
only to worker threads, since it is explicitly designed to be used for long-running off-thread applications, like wasm. Now that TC39 has made the method normative optional, I'd like to continue the discussion here.Cc @codehag for Mozilla and @kmiller68 for Apple. Please cc other stakeholders.
The text was updated successfully, but these errors were encountered: