[comp.parallel] Optimistic expression construct

delagi@sumex-aim.stanford.edu (Bruce Delagi) (11/14/88)

In languages supporting futures, one could write something like

     (let ((b (future ...some-expression...))
           (c (future ...other-expression...)))
       (if a (...an-expression-requiring-the-value-of-b)
             (...an-expression-requiring-the-value-of-c)))

to get the effect of explicitly starting off optimistic calculations.  Only
one of the calculations would need to return a value to return a value for
the form as specified above.  If the pattern were useful enough, a macro
could be provided encapsulating the pattern as a language construct I think.

/bruce

wagner@june.cs.washington.edu (Bullwinkle J. Moose) (11/21/88)

In article <3532@hubcap.UUCP>, delagi@sumex-aim.stanford.edu (Bruce Delagi) writes:
> In languages supporting futures, one could write something like
> 
>      (let ((b (future ...some-expression...))
>            (c (future ...other-expression...)))
>        (if a (...an-expression-requiring-the-value-of-b)
>              (...an-expression-requiring-the-value-of-c)))
> 
> to get the effect of explicitly starting off optimistic calculations.  Only
> one of the calculations would need to return a value to return a value for
> the form as specified above.

Yes, but the unused calculation would continue to completion, which
could waste processor resources.


		Dave Wagner
		University of Washington Comp Sci Department
		wagner@cs.washington.edu
		{cornell,harvard,ssc-vax,tektronix}!uw-beaver!wagner