tc39 / proposal-ecmascript-sharedmem

Shared memory and atomics for ECMAscript
Mozilla Public License 2.0
375 stars 32 forks source link

GetWaiterList "same"ness #128

Closed jfbastien closed 7 years ago

jfbastien commented 8 years ago

GetWaiterList says:

The agent cluster has a store of WaiterList objects; the store is indexed by (block, i). WaiterLists are agent-independent: a lookup in the store of WaiterLists by (block, i) will result in the same WaiterList object in any agent in the agent cluster.

What does "same" mean? When invoked concurrently it could return different results. Is there even a way to observe same-ness besides having a coherent order (i.e. Lamport timestamps)?

Can different threads observe different interleavings in the WaiterList? (I assume not).

lars-t-hansen commented 8 years ago

"Same" is intended to convey that when you access the object (read the list of waiters or write the list of waiters from within the appropriate critical section) then those changes become observable to other agents (when they are in the appropriate critical section) regardless of in which order and at what time those agents obtained the WaiterList objects. I don't know what "when invoked concurrently it could return different results" means since the spec says it's not allowed to do that (it must be the "same").

I'm happy if you can suggest something more precise, but I am a bit mystified that you are mystified here :)

Edit: clarification.

lars-t-hansen commented 7 years ago

Please file issue against ecma262 if you feel the current prose is still unclear. https://tc39.github.io/ecma262/#sec-getwaiterlist.