It may also be that, when every thread finishes with a particular item in the 
stream Xs the given item could be garbage collected (as Xs is a list).
That is, when every thread finishes using the "0" in Xs, the "0" can be garbage 
collected, then the "1", the "2", etc., as every thread finishes using these 
items, on down the line.

-- Harmon

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrés Becerra 
Sandoval 
Sent: Thursday, February 09, 2006 9:57 AM
To: [EMAIL PROTECTED]
Subject: Re: streams & multiple readers

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

Reply via email to