Open
Bug 1263215
Opened 9 years ago
Updated 2 years ago
refactor WorkerRunnable::Dispatch() scheme so runnable object always releases on target worker thread
Categories
(Core :: DOM: Workers, task, P3)
Core
DOM: Workers
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox48 | --- | affected |
People
(Reporter: bkelly, Unassigned)
References
Details
Currently the WorkerRunnable::Dispatch() method is designed such that the dispatching thread always holds a ref after the dispatch. This makes it racy as to which thread will actually finally release the runnable object.
In order to fix this we would have to replace WorkerRunnable::PostDispatch() with something else. Right now there are no PostDispatch() method impls that significantly use any runnable state. So we could probably remove it and replace it with a behavior object thats used only on the dispatching thread.
Another alternative would be to create an explicit "ReleaseWorkerThreadObjects()" method on WorkerRunnable that implementing classes could override.
I think it would be nicer to fix the race if we can since it adds to the overall complexity of writing code for workers.
Updated•9 years ago
|
Whiteboard: btpp-fixlater
Updated•8 years ago
|
Priority: -- → P2
Whiteboard: btpp-fixlater
Updated•8 years ago
|
Priority: P2 → P3
Comment 1•5 years ago
|
||
:asuth, is this still something we want to do?
Type: defect → task
Flags: needinfo?(bugmail)
Comment 2•3 years ago
•
|
||
(In reply to Ben Kelly [:bkelly, not reviewing] from comment #0)
Right now there are no PostDispatch() method impls that significantly use any runnable state. So we could probably remove it and replace it with a behavior object thats used only on the dispatching thread.
Looking at searchfox I actually find only few PostDispatch
that do something more than just assert and only one that accesses inner state, so I guess the claim "there are no impls that significantly use any runnable state" still holds.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•