Consider releasing the helper thread lock before calling the task dispatch callback
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox127 | --- | fixed |
People
(Reporter: jandem, Assigned: jonco)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(2 files)
I noticed in a profile that the browser's DispatchOffThreadTask
can be fairly slow because it does task controller lock/malloc stuff. We currently call this callback with the helper thread lock held; if possible we should consider unlocking to unblock other threads.
We do need the lock for the internal thread pool dispatch, but we could either make it conditional or lock inside the internal thread pool's dispatch callback.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 1•1 year ago
|
||
This changes UnlockGuard to work with anything that supplies lock and unlock
methods so that it can be used with subclasses of LockGaurd that do extra work
in these methods.
The unused AutoUnlockMonitor is removed.
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
This works by keeping a count of tasks to dispatch on AutoLockHelperThreadState
which are handled when it is unlocked. One issue is that we must take care not
to wait for a helper task to complete before we've had a chance to displach the
task we're going to wait on.
Comment 4•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/167f127cbbca
https://hg.mozilla.org/mozilla-central/rev/b0664939a81e
Description
•