Convert the thread 'mtransport' to use the background thread pool
Categories
(Core :: WebRTC: Networking, task, P3)
Tracking
()
People
(Reporter: KrisWright, Unassigned)
References
(Blocks 1 open bug)
Details
The thread mtransport [1] uses the NS_NewNamedThread method, so it might be possible to move it to the background thread pool.
In an effort to reduce the number of ad-hoc threads in the browser, we want to convert instances of NS_NewNamedThread to use the background thread pool [2] wherever possible. If your thread may block, you can also include the NS_DISPATCH_EVENT_MAY_BLOCK flag.
[1] https://searchfox.org/mozilla-central/rev/c79c0d65a183d9d38676855f455a5c6a7f7dadd3/media/mtransport/nr_socket_prsock.cpp#263
[2] https://searchfox.org/mozilla-central/rev/91f6c02fcf4c16f78fdc4417f61f192688294066/xpcom/threads/nsThreadUtils.h#1730-1757
Comment 1•6 years ago
|
||
Marking this a P2 after discussion w/ Byron. The main concern here is whether using NS_DISPATCH_EVENT_MAY_BLOCK will work well for us and provided the serial execution we need. This would be a nice simplification opportunity if it works in this case.
| Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Michael Froman [:mjf] from comment #1)
Marking this a P2 after discussion w/ Byron. The main concern here is whether using NS_DISPATCH_EVENT_MAY_BLOCK will work well for us and provided the serial execution we need. This would be a nice simplification opportunity if it works in this case.
For serial execution, you can get a TaskQueue to dispatch to the thread pool using NS_CreateBackgroundTaskQueue.
Updated•3 years ago
|
Updated•1 year ago
|
Description
•