Promises (was: Re: Light-weight monitor implementation?)

Cees De Groot cdegroot at gmail.com
Thu Nov 3 12:41:52 UTC 2005


On 11/3/05, Lukas Renggli <renggli at gmail.com> wrote:
> I don't know what the exact E semantics are (anyone knows a link with
> the  specifications?), but it should certainly block if the result is
> not ready. And there is also the thing with the exceptions ...
>
http://www.erights.org/elib/distrib/pipeline.html and other pages on that site.

One of the biggest differences is that you can perform computations
with promises - the result is another promise, etcetera. Only when you
really really really need to do something acute to the promise you end
up with, you block waiting for all the work to finish.

So:

foo := [1 + 2] asPromise.
bar := foo + 3
"bar is now a promise if foo wasn't finished yet, so doesn't block"
Transcript show: bar printString; cr.
"now we need to value of the whole thing, so that blocks"

At least, that's what I seem to remember. Disclaimer: I'm getting
seriously old so more and more memory cells are failing...



More information about the Squeak-dev mailing list