Alternative to Promise
benjamingr at gmail.com
Sun Oct 4 08:00:28 UTC 2015
On Sat, Oct 3, 2015 at 5:37 PM, 韩冬 <handong05 at meituan.com> wrote:
> This is exactly where i’m getting puzzled, suppose we have thread in
> consider following code:
current environments that support multicore calculations. Those who do have
shared memory do not have *arbitrary* shared memory. If we do choose to
support threads in the future, the algorithms in Promise, as well as in
many other places in the specification would have to drastically change.
Currently, the specification is not thread aware in any way. ECMAScript
implementations typically deal with concurrency though a single threaded
non-blocking event loop model where other heavy computation is offloaded to
processes or to the platform.
> During pending stage, both func1 and func2 are going to pushed into an
> internal array, shouldn’t this array resize operation be protected by a
If there are multiple threads then yes. As explained above, ECMAScript
itself has no locks.
> Thanks for your explanations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss