Microtasks in the promise specification
# Allen Wirfs-Brock (12 years ago)
coming soon to a ES6 draft near you...
coming soon to a ES6 draft near you... Allen On Dec 7, 2013, at 3:11 PM, Daira Hopwood wrote: > I was reading the draft specification of an ES6 promise API in > <https://github.com/domenic/promises-unwrapping/blob/master/README.md>, > and noticed that the definition of microtasks seems underspecified. > > I see this has been discussed to some extent in > <https://github.com/promises-aplus/promises-spec/issues/139>. However, > it seems to have been implicitly assumed that the execution model is > sequential. Given that things called "tasks" in several other languages > are executed in parallel, it seems to me that this assumption should be > made explicit. That is, it should be explicitly stated that microtasks > must be executed to completion sequentially with respect to other code > and other microtasks. (Otherwise, there can be data races on accesses > to shared locations, which is clearly not desirable or intended.) > > -- > Daira Hopwood ⚥ > > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss
I was reading the draft specification of an ES6 promise API in domenic/promises-unwrapping/blob/master/README.md, and noticed that the definition of microtasks seems underspecified.
I see this has been discussed to some extent in promises-aplus/promises-spec#139. However, it seems to have been implicitly assumed that the execution model is sequential. Given that things called "tasks" in several other languages are executed in parallel, it seems to me that this assumption should be made explicit. That is, it should be explicitly stated that microtasks must be executed to completion sequentially with respect to other code and other microtasks. (Otherwise, there can be data races on accesses to shared locations, which is clearly not desirable or intended.)