On 2015/05/05 15:27:29, jochen wrote:
I tried to think a bit about how we could make progress here.

What is essentially unclear to me is how the memory model, atomics, etc.. will
be implemented.

My understanding of the memory model is this: normal SAB accesses work the same
as
ArrayBuffer accesses. Any other guarantees would be too slow. It's up to the
developer
to correctly synchronize their application via the Atomics API. The suggestions
I've
gotten for implementation are to use
http://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html
for the atomics instruction sequences.


On a high level, this CL just introduces an alias for ArrayBuffer et al
without
any functional change. However, if that's the way it's supposed to be in the
end, we can have this with far less changes to V8.

As I understand it, SAB at the V8 level isn't supposed to have different
behavior,
but it needs to be distinguishable from an ArrayBuffer/TypedArray at all levels,
and it needs to have a different API. The Atomics API only works on SAB, for
example. If we can do this with a smaller CL, that would be great!


So maybe we should instead first do the really hairy bits, e.g. teach the
three
compiles to do atomic accesses?

I'm working on a CL for that here: https://codereview.chromium.org/1124813005/.
I'm just using the __atomic_* builtins for now, for simplicity.


I think before we add SharedArrayBuffer as done in this CL, we should also
figure out the desired interaction with Blink and Chrome.

Please take a look at the CL here: https://codereview.chromium.org/1097773004/

I think the desired behavior in Blink is that a SharedArrayBuffer works almost exactly like an ArrayBuffer (with a smaller API). It must not be allowed to be used where an ArrayBuffer can be used. It also can be shared with a Worker by
including it in the "transfer" argument of worker.postMessage.

https://codereview.chromium.org/1069883002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to