Closed Bug 1665572 Opened 4 years ago Closed 4 years ago

Remove GCParallelTask finishing state

Categories

(Core :: JavaScript: GC, task, P3)

task

Tracking

()

RESOLVED FIXED
82 Branch
Tracking Status
firefox82 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(2 files)

Currently GCParallelTask's virtual run() method is called without the helper thread lock held. This makes it hard to check whether long running tasks are still active and able to receive more work from the main thread. Typically a task will check its work queue with the lock held and then return if it's empty, but currently it will have to release the lock first creating an opportunity for a race.

As a workaround we added a 'finishing' state which a task can enter when it can't perform any more work and it s about to return. The main thread can check whether the task has already entered this state before trying to give it more work to do.

Calling the run method with the lock held allows us to remove this state since the helper thread no longer required to release the lock after checking its work queue. Care must be taken to release the lock before starting work however.

The first part is to call this method with the lock held and update the implementations.

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f47f1fdf60ab
Call GCParallelTask::run() method with the helper thread lock held r=jandem
https://hg.mozilla.org/integration/autoland/rev/73f12705b4b6
Remove GCParallelTask's 'finishing' state which is no longer needed now that task execution happens with the lock held r=jandem
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: