Bringing setTimeout to ECMAScript

Sam Tobin-Hochstadt samth at ccs.neu.edu
Sat Mar 19 16:20:00 PDT 2011


On Sat, Mar 19, 2011 at 6:50 PM, Brendan Eich <brendan at mozilla.com> wrote:
> setTimeout does not introduce threads, shared memory among them, or even
> non-determinism if we spec carefully (browsers have to implement carefully
> already).

`setTimeout' already introduces nondeterminism based on the speed of
the implementation.  Consider:

setTimeout(f1,1000)
compute()
setTimeout(f2,0)

If `compute' takes a long time, then `f1' runs before `f2', otherwise
`f2' runs first.

-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list