Closed
Bug 1449189
Opened 7 years ago
Closed 7 years ago
Does ~ExclusiveData() really need to take a lock?
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: luke, Assigned: luke)
Details
Attachments
(2 files)
3.27 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
5.00 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
This bug is to ask whether we can revert bug 1260891. The reasoning there makes conservative sense: since the destructor is about to read shared values, we need to ensure previous read happen-before the destructor. However, I think we have this happens-before relationship even without acquiring the lock: ~ExclusiveData must not race with any other use of the object since, if the other use loses the race, it will be using a dead object. This implies that the user of ExclusiveData must externally ensure that destructions happens-after all previous uses. Practically speaking, this will be ensured by any extant threads or tasks on other threads having been joined/completed/canceled by the time the ExclusiveData is destroyed.
Updated•7 years ago
|
Priority: -- → P3
![]() |
Assignee | |
Comment 1•7 years ago
|
||
Assignee: nobody → luke
Attachment #8963148 -
Flags: review?(nfitzgerald)
Comment 2•7 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #0)
> This bug is to ask whether we can revert bug 1260891. The reasoning there
> makes conservative sense: since the destructor is about to read shared
> values, we need to ensure previous read happen-before the destructor.
> However, I think we have this happens-before relationship even without
> acquiring the lock: ~ExclusiveData must not race with any other use of the
> object since, if the other use loses the race, it will be using a dead
> object. This implies that the user of ExclusiveData must externally ensure
> that destructions happens-after all previous uses. Practically speaking,
> this will be ensured by any extant threads or tasks on other threads having
> been joined/completed/canceled by the time the ExclusiveData is destroyed.
This makes perfect sense. Thanks!
Taking a look at the patch now.
Comment 3•7 years ago
|
||
Comment on attachment 8963148 [details] [diff] [review]
no-lock-in-dtor
Review of attachment 8963148 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM!
Attachment #8963148 -
Flags: review?(nfitzgerald) → review+
![]() |
Assignee | |
Comment 4•7 years ago
|
||
Follow-up simplification allowed by previous patch.
Attachment #8963723 -
Flags: review?(bbouvier)
Comment 5•7 years ago
|
||
Comment on attachment 8963723 [details] [diff] [review]
simplify-sig-id-set
Review of attachment 8963723 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good! Any chance we could put the SigSet in WasmProcess too, or is that too much hassle?
Attachment #8963723 -
Flags: review?(bbouvier) → review+
![]() |
Assignee | |
Comment 6•7 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #5)
Conceptually that sounds nice, but it would increase the scope of SigIdSet from being a WasmInstance.cpp-internal detail to a whole-wasm/-visible thing, so unless there was some more tangible benefit for colocating all the process-lifetime things, I'd default to keeping it where it is.
Pushed by lwagner@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b7418660fe2
Don't lock in ~ExclusiveData (r=fitzgen)
https://hg.mozilla.org/integration/mozilla-inbound/rev/fbcb35097910
Baldr: remove ExclusiveData indirection (r=bbouvier)
Comment 8•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9b7418660fe2
https://hg.mozilla.org/mozilla-central/rev/fbcb35097910
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•