Comments on Sept Meeting Notes
dherman at mozilla.com
Fri Sep 27 10:14:37 PDT 2013
On Sep 27, 2013, at 10:02 AM, David Herman <dherman at mozilla.com> wrote:
> - don't share symbols between workers
Follow-up thought: it seems there are actually two concepts that both get grouped under "realms" and yet might warrant distinction. These correspond on the web to two same-origin windows vs two workers.
Between same-origin windows, you have different realms but a shared heap. In that case, you really want e.g. @@iterator to be === regardless of the realm it comes from. If one same-origin window shares an iterable object with another same-origin window, we want it to remain iterable. So we really want to specify that within a heap, multiple realms can share symbols (there's no way to stop them from sharing them anyway) and the ES6 standard symbols are unique. This also means that you want one registry shared across realms within that heap. I still don't think this needs new mechanism from the language, though, since same-origin windows can synchronously communicate to handshake on a shared registry object.
Between workers, you have different realms and completely separate heaps. Allen's suggestion has @@iterator being completely uncommunicable between the different heaps.
So I think Allen's protocol still works, you just have to have sharing of symbols across multiple realms that exist within the same worker/heap/vat/whatchamacallit.
More information about the es-discuss