Hello,
As the stream Xs is a local variable, when the execution of the local
.. end block finishes, the garbage collector can recycle it.
It will not do it before the threads doing the sum finish their
execution, because they have a dependency on Xs.
So, Xs ** will be ** recycled automaticaly, and after the two sums
finish correctly !
--
Andrés
On 2/9/06, Aurélien Campéas <[EMAIL PROTECTED]> wrote:
> Hello,
>
> pp 258-259 of CTM are about multiple readers for streams ...
>
> local Xs S1 S2 S3 in
> thread Xs={Generate 0 150000} end
> thread S1={Sum Xs 0} end
> thread S2={Sum Xs 0} end
> ...
> end
>
> this implies that the stream a) is not really consummed by the threads,
> hence b) the 150000 elements reside in memory c) it looks quite
> difficult how to decide when to release them
>
> I'm really puzzled with this aspect of streams ... (I hope this isn't a
> FAQ).
>
> Cheers,
> Aurélien.
>
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users