--- scheme-scheduling.texi.~1.10.~ 2003-05-05 10:18:26.000000000 +1000 +++ scheme-scheduling.texi 2003-06-01 08:55:41.000000000 +1000 @@ -12,6 +12,7 @@ * Dynamic Roots:: Root frames of execution. * Threads:: Multiple threads of execution. * Fluids:: Thread-local variables. +* Futures:: Delayed execution in new threads. @end menu @@ -647,6 +648,30 @@ when control enter or leaves the established dynamic extent. @end deffn + address@hidden Futures address@hidden Futures address@hidden futures + +Futures are a convenient way to run a calculation in a new thread, and +only wait for the result when it's actually needed. + +Futures are similar to promises (@pxref{Delayed Evaluation}), in that +they allow mainline code to continue immediately. But @code{delay} +doesn't evaluate at all until forced, whereas @code{future} starts +immediately in a new thread. + address@hidden {syntax} future expr +Begin evaluating @var{expr} in a new thread, and return a ``future'' +object representing the calculation. address@hidden deffn + address@hidden {Scheme Procedure} future-ref f +Return the value computed by the future @var{f}. If @var{f} has not +yet finished executing then wait for it to do so. address@hidden deffn + + @c Local Variables: @c TeX-master: "guile.texi" @c End: