Prevent new ad hoc additions of NS_NewNamedThread
Categories
(Core :: XPCOM, enhancement)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | fixed |
People
(Reporter: KrisWright, Assigned: KrisWright)
References
(Blocks 3 open bugs, Regressed 2 open bugs)
Details
Attachments
(1 file)
Unless there is a very specific reason not to, we want to encourage async work to go to the background thread pool (bug 1595241) instead of going into another new one-off thread. There are a lot of benefits to using this pool, and it also benefits the future scheduler to reduce our overall thread count and have them funneling into some common mechanism.
To cap the creation of new threads, we want to introduce a mechanism that deprecates new additions of NS_NewNamedThread [1]. I can see us doing this with a clang plugin and a whitelist of all the existing instances of NS_NewNamedThread.
Comment 1•1 year ago
|
||
(It would be good to remove NS_NewThread by that point, otherwise people might be tempted to use it instead of NS_NewNamedThread to get around the error.)
| Assignee | ||
Comment 2•1 year ago
•
|
||
(In reply to Markus Stange [:mstange] from comment #1)
(It would be good to remove
NS_NewThreadby that point, otherwise people might be tempted to use it instead ofNS_NewNamedThreadto get around the error.)
This is a good point, and I think fixing bug 1539944 should be a part of this process.
| Assignee | ||
Comment 3•1 year ago
|
||
Creates a NoNewThreadsChecker plugin that looks for the function and checks to see if it's allowed. This is still WIP and will break your build.
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Pushed by kwright@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/459a77fff516 Add new clang plugin to deprecate NS_NewNamedThread r=andi
Comment 5•1 year ago
|
||
Backed out changeset 459a77fff516 (bug 1613440) for Clang bustage on tools/extra/clang-tidy/mozilla/Utils.h. CLOSED TREE
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=290242622&repo=autoland&lineNumber=6666
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&revision=459a77fff5166bb4fa82262a5af5d169883dcd95&selectedJob=290242622
Backout:
https://hg.mozilla.org/integration/autoland/rev/868f3fcb3a011832c47ad297b9e993ef22d03317
Pushed by kwright@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f400f164b394 Add new clang plugin to deprecate NS_NewNamedThread r=andi
| Assignee | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
| bugherder | ||
Description
•