One of the main novel concepts relative to SML are futures . This structure provides three basic primitives to create futures. It immediately returns a future associated with that thread. When the procedure terminates with a result that is different from the future, this future is globally replaced with the result. As soon as a thread blocks on the future, the argument procedure is applied in a new thread.
Evaluation proceeds similar to concur .
By-need futures can be used for lazy evaluation . Both these operations are in the top-level environment and can thus be used unqualified. This is useful for programming timeouts and the like. On futures await blocks until the future is replaced by a proper value. It then returns the first argument.