Eliminate busy count tracking from WorkerRunnables
Categories
(Core :: DOM: Workers, enhancement)
Tracking
()
People
(Reporter: asuth, Assigned: edenchuang)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
Eliminate busy count tracking in favor of just letting WorkerRefs, the existence of IPC actors, and (newly proposed) the presence of events in our main-thread ThrottledEventQueues/worker debugee queues keep a worker alive. This enables a simplification of the WorkerRunnable implementation. This is a spin-off follow-up from bug 1800659 which going to originally address this (but which quite reasonably was de-scoped).
One particular benefit is there is no need for runnables sent to the main thread to have a reference to the WorkerPrivate (to update the busy count), however it's likely that we would want to approximate the original design behavior by having the GC traversal logic in WorkerPrivate::Traverse that Worker::Traverse calls into:
- Check if there are any runnables in our mMainThreadDebuggeeEventTarget main thread-targeted ThrottledEventQueue. This is a new proposal with the filing of this bug, but an easy thing for us to check that could potentially allow us to continue to GC in more cases.
- We also would like to be aware of runnables resulting from Worker.postMessage; most practically having any runnables in the queue would be sufficient but would err on the side of GCing less.
- Check if there are StrongWorkerRefs. (IPCWorkerRefs would continue to not prevent GC, as would also be the case for WeakWorkerRefs.)
Assignee | ||
Updated•1 years ago
|
Assignee | ||
Comment 1•1 years ago
|
||
I have some local patches for this, so I take this bug.
Assignee | ||
Comment 2•1 year ago
|
||
Description
•