Closed Bug 1602167 Opened 1 year ago Closed 1 year ago

Make it possible to pass more than just NS_DISPATCH_AT_END from a TaskQueue


(Core :: XPCOM, task)

Not set



Tracking Status
firefox73 --- fixed


(Reporter: KrisWright, Assigned: KrisWright)




(1 file)

In Bug 1593812, a dispatch flag was added specifically for I/O awareness in the background thread pool [1]. This flag determines if the runnable needs to be dispatched to the general purpose background thread pool or the I/O background thread pool. However, if a TaskQueue running with NS_DISPATCH_EVENT_MAY_BLOCK has more tasks left in its queue, it will send itself to dispatch again to the wrong thread pool because it ignores its original flag and dispatches with NS_DISPATCH_AT_END [2].

I think the most straightforward way to fix it is to add an optional additional dispatch flag field specifically for flags like NS_DISPATCH_EVENT_MAY_BLOCK which determine which thread pool to dispatch in, assuming this issue may arise again later. In the future it may be worthwhile to create some way to pass more information than just a flag to dispatch.


Summary: Make it possible to pass more than one of NSIThreadManager's dispatch flags → Make it possible to pass more than just NS_DISPATCH_AT_END from a TaskQueue

Makes TaskQueue's queue hold a struct with each runnable and its flags. When specified, flags will be stored and passed with NS_DISPATCH_AT_END when TaskQueue::Runner dispatches itself back to its event target.

Assignee: nobody → kwright
Pushed by
Make TaskQueue capable of retaining its dispatch flags r=froydnj
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
See Also: → 1646054
You need to log in before you can comment on or make changes to this bug.