Closed
Bug 1253350
Opened 9 years ago
Closed 9 years ago
Shared memory spec change: futexWake / futexWakeOrRequeue "count" argument
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: lth, Assigned: lth)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
5.76 KB,
patch
|
bbouvier
:
review+
|
Details | Diff | Splinter Review |
The meaning of the count argument has changed: it defaults to +Infinity, not 0.
Note, the futex functions may go away, we should not implement the change until that is settled.
Comment 1•9 years ago
|
||
Dev docs to be updated once this is resolved:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/futexWake
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/futexWakeOrRequeue
Keywords: dev-doc-needed
Assignee | ||
Comment 2•9 years ago
|
||
The futex functions will not go away (well, futexWakeOrRequeue may but futexWake will not) so we should fix this.
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8734392 -
Flags: review?(bbouvier)
Comment 4•9 years ago
|
||
Comment on attachment 8734392 [details] [diff] [review]
count argument of futexWake defaults to +Infinity
Review of attachment 8734392 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good!
::: js/src/builtin/AtomicsObject.cpp
@@ +901,5 @@
> uint32_t offset1;
> if (!GetTypedArrayIndex(cx, idx1v, view, &offset1))
> return false;
> double count;
> + if (countv.isUndefined()) {
Overly-annoying reviewer would suggest to share this code in a static function; reviewee does not have to listen, though. (I'm reading futexWakeOrRequeue might disappear anyway)
::: js/src/tests/shell/futex.js
@@ +9,5 @@
> reportCompare(true,true);
> quit(0);
> }
>
> +var DEBUG = true;
nit: probably unintended change?
@@ +107,5 @@
> +
> +evalInWorker(`
> +var mem = new Int32Array(getSharedArrayBuffer());
> +sleep(1);
> +Atomics.futexWake(mem, 0); // Last argument should default to +Infinity
If you had the call to futexWait before the call to futexWake, could you also assertEq(Atomics.futexWake(mem, 0), 1); ? (if futexWait can be run on a worker too)
Attachment #8734392 -
Flags: review?(bbouvier) → review+
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Benjamin Bouvier [:bbouvier] from comment #4)
> Comment on attachment 8734392 [details] [diff] [review]
> count argument of futexWake defaults to +Infinity
>
> Review of attachment 8734392 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Looks good!
>
> ::: js/src/builtin/AtomicsObject.cpp
> @@ +901,5 @@
> > uint32_t offset1;
> > if (!GetTypedArrayIndex(cx, idx1v, view, &offset1))
> > return false;
> > double count;
> > + if (countv.isUndefined()) {
>
> Overly-annoying reviewer would suggest to share this code in a static
> function; reviewee does not have to listen, though. (I'm reading
> futexWakeOrRequeue might disappear anyway)
Reviewee is not annoyed but notes that futexWakeOrRequeue will go away.
> ::: js/src/tests/shell/futex.js
> @@ +9,5 @@
> > reportCompare(true,true);
> > quit(0);
> > }
> >
> > +var DEBUG = true;
Oops.
> @@ +107,5 @@
> > +
> > +evalInWorker(`
> > +var mem = new Int32Array(getSharedArrayBuffer());
> > +sleep(1);
> > +Atomics.futexWake(mem, 0); // Last argument should default to +Infinity
>
> If you had the call to futexWait before the call to futexWake, could you
> also assertEq(Atomics.futexWake(mem, 0), 1); ? (if futexWait can be run on a
> worker too)
That would be a nice improvement. "Before" is not always so easy to arrange but I'll look into it.
Comment 6•9 years ago
|
||
This landed with the wrong bug number in the commit message. Please double-check that in the future before pushing.
https://hg.mozilla.org/mozilla-central/rev/df3ddeee1647
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Comment 7•9 years ago
|
||
Updated https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/futexWake
Not going to add any compatibility note as this is an experimental API anyway and we are shipping the old behavior for 2 releases only (will this be uplifted?).
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•