Closed Bug 951542 Opened 11 years ago Closed 10 years ago

PJS: Race between interrupt check and main thread finishing

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: shu, Assigned: shu)

Details

Attachments

(1 file)

We currently race between the main thread finishing its work and a worker
thread trying to abort due to the interrupt flag. If the main thread has
already finished its work, the worker thread will never abort.
Attached patch fixSplinter Review
Attachment #8349226 - Flags: review?(nmatsakis)
Comment on attachment 8349226 [details] [diff] [review]
fix

Review of attachment 8349226 [details] [diff] [review]:
-----------------------------------------------------------------

This seems fine, although it might be easier (or at least more self-contained) to add a (volatile/atomic) flag to the ForkJoinShared that gets set when executeFromMainThread() returns.
Attachment #8349226 - Flags: review?(nmatsakis) → review+
(In reply to Niko Matsakis [:nmatsakis] from comment #2)
> Comment on attachment 8349226 [details] [diff] [review]
> fix
> 
> Review of attachment 8349226 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> This seems fine, although it might be easier (or at least more
> self-contained) to add a (volatile/atomic) flag to the ForkJoinShared that
> gets set when executeFromMainThread() returns.

That'd be the preferred solution in the current world, but doesn't work with work stealing, thus the RAII thing.
https://hg.mozilla.org/mozilla-central/rev/1e4903ca67df
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: