Don't require the main thread to start PBackground instances
Categories
(Core :: IPC, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox98 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Currently, starting a PBackground actor always requires visiting the main threads in both the creating process and the target process due to the existing design and requiring main-thread actors for messaging of Endpoint instances. We could instead create the actors with an actor which runs on a background TaskQueue in content processes, and the background thread in the parent process. Messages would be bounced to this task queue instead of to the main thread, potentially greatly decreasing latency.
| Assignee | ||
Comment 1•4 years ago
|
||
This patch avoids requiring the main thread to create PBackground instances by
instead using a background starter TaskQueue, and sending messages from a
PBackgroundStarter actor hosted on that thread to the target background thread
directly. On the background thread, the relevant metadata is already registered
and present in the BackgroundStarterParent actor allowing the main thread in
both processes to be bypassed completely.
Various tasks remain bound to the main thread, such as PBackground cleanup and
async steps involved in PBackground creation.
This patch also unifies the in-process and cross-process PBackground codepaths,
allowing in-process PBackground creation to bypass the main thread as well, and
removing the need for a main thread event target from
GetOrCreateForCurrentThread().
Comment 3•4 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Description
•