tc39 / proposal-ecmascript-sharedmem

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

Atomics uses iterators and pairs? #171

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello. I suggest add next things:

  1. Address iterator
    
    // ...
    let u32 = new Uint32Array(shared_memory);
    let tpi = u32.memories(0); // get pair iterator from zero keys
    let pair0 = tpi.next(); // get iterator value of zero key with [u32, 0]
    let pair1 = tpi.next(); // get iterator value of next key with [u32, 1]
    // may have another form of iteration

let pair0a = u32.mem(0); // get iterator value directly with zero key with [u32, 0]


2. Pair atomics acceptance 
```js
// ...
let before = Atomics.add(pair0, 1); // instead of longest writing, we using iterator values
let one = Atomics.add(pair0a, 1); 

Instead of using typed array instance with indexing, I suggest just using iterations and objective pairs.

lars-t-hansen commented 7 years ago

I confess I don't understand what you're proposing, but in any case the shared memory proposal is complete and this repo is inactive (apart from addressing and closing existing bugs). Additional proposals for functionality need to go through the process for proposals in ECMAScript. There is some starting information about how to submit proposals here: https://github.com/tc39/ecma262/blob/master/CONTRIBUTING.md.