Make SharedThreadPool less volatile
Categories
(Core :: XPCOM, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox149 | --- | fixed |
People
(Reporter: jstutte, Assigned: jstutte)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 5 obsolete files)
Currently SharedThreadPool shuts down a pool as soon as consumers do not hold a reference to it. In case of consumers acquiring a new reference frequently without keeping it across uses, this can lead to many thread shutdowns and re-creations. MediaPDecoder seems to be an example of such usage. It seems in WebRTC code we added some AddRef calls here and there to account for this.
It might be easier for consumers, if SharedThreadPool keeps an ever-used pool alive until shutdown. If it is really not used for a while, all its threads will be closed and we would just consume the thread pool's object memory.
| Comment hidden (obsolete) |
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
•
|
||
Looking at how SharedThreadPool manages its shutdown I came across:
nsThreadPool::PutEventbails out on shutdown regardless of the source of an event.
if (NS_WARN_IF(mShutdown && !IsOnCurrentThreadInfallible()))might be a better choice, together with avoiding to spawn a new thread below whenmShutdown(the one we are running on can just take the event).
which might deserve an own bug.
| Assignee | ||
Comment 4•1 year ago
|
||
We might also want to consider renaming SharedThreadPool.
| Comment hidden (obsolete) |
| Comment hidden (obsolete) |
Updated•6 months ago
|
| Comment hidden (obsolete) |
Updated•6 months ago
|
Updated•6 months ago
|
Updated•3 months ago
|
| Assignee | ||
Comment 8•3 months ago
|
||
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
| Comment hidden (obsolete) |
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
| Assignee | ||
Updated•2 months ago
|
Comment 10•2 months ago
|
||
Comment on attachment 9501751 [details]
Bug 1895846 - Ensure PostTimerEvent will not release anything important while holding the monitor's lock. r?#xpcom-reviewers
Revision D257966 was moved to bug 1999508. Setting attachment 9501751 [details] to obsolete.
| Assignee | ||
Comment 11•2 months ago
|
||
| Assignee | ||
Comment 12•2 months ago
|
||
Now that all SharedThreadPools are explicitly shutdown regardless of other objects still referencing them, we can leverage the shutdown tasks also here to shut down associated TaskQueues (and maybe other things registering in the future).
Comment 13•12 hours ago
|
||
Comment 14•10 hours ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e85d06f7dc60
https://hg.mozilla.org/mozilla-central/rev/6976ad06cf8d
https://hg.mozilla.org/mozilla-central/rev/dc866ea7c36b
Description
•