Closed
Bug 1583964
Opened 5 years ago
Closed 5 years ago
make `IsOnCurrentThread` for thread pools constant-time
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla71
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: froydnj, Assigned: froydnj)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Comment 1•5 years ago
|
||
It's fairly common for clients to hold a pointer to some private thread
and then inquire about IsOnCurrentThread
in debug checks. As we
migrate these private threads into some nsIEventTarget
implementation
that might be running on thread pools, we need to ensure that those
IsOnCurrentThread
continues to be relatively cheap. The current
implementation for thread pools is not particularly efficient.
The inefficiency comes from having to iterate over all the threads in
the pool. But there's no need to do this; we can just have each thread
set a particular thread-local variable to the thread pool it's running
on, and check the value of that thread-local variable instead.
Pushed by nfroyd@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3d366bfc0508 make `IsOnCurrentThread` for thread pools constant-time; r=KrisWright
Comment 3•5 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox71:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Updated•5 years ago
|
Assignee: nobody → nfroyd
You need to log in
before you can comment on or make changes to this bug.
Description
•