ByNeedFuture revisited
Raphael Collet
raph at info.ucl.ac.be
Thu Oct 2 12:17:58 CEST 2003
Denys wrote:
> I would like to make 2 proposals concerning NyNeedFuture:
>
> 1. it is currently poorly defined because it does not automatically
> address the issue of escaping exceptions. I submit that it would
> be more USEFUL to define it as follows:
>
> proc {ByNeedFuture P X}
> R={NewReadOnly}
> in
> thread
> {WaitNeed R}
> {BindReadOnly R
> try {P} catch E then {Value.failed E} end}
> end
> X=R
> end
I like the proposal very much.
> 2. I would like the old futures to be retained SOLELY for the purpose
> of providing an optimized implementation of ByNeedFuture (and
> ByNeedDot) where no resource is allocated until the future becomes
> needed.
Okay, I'll try to make it so. Kevin had an idea for delaying the
allocation of resource until a by-need computation is needed.
The idea is to create cheap suspensions for that purpose. I think
it might be a good optimization, and allow us to remove futures.
But that's "future" work ;-)
Cheers,
raph
-
Please send submissions to hackers at mozart-oz.org
and administriva mail to hackers-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-hackers
mailing list