Aurélien Campéas writes: > Le jeudi 09 février 2006 à 17:25 +0100, Kevin Glynn a écrit :
> > > > All data that is no longer reachable from any thread in the system is > > garbage and can be collected by a garbage collection. So, if Xs isn't > > used in the ... part of your example then any portion of Xs that has > > been processed by both Sum threads will be garbage. That is, we don't > > need to wait until the Sum threads have completed before reclaiming > > the space used by the finished with portion of Xs. > > > > So, in the best case if we were lucky with the scheduling of threads > > (you won't be!) then the above program could run in constant space. > > But worst case implies growing the whole stream in memory. > > > > > If we generated Xs lazily (sec 4.5 of CTM) and only consumed it once > > then it would run in constant space. > > I was really looking for the bounded buffer solution of 4.3.3.2 > OK, but for completeness I should also have pointed out that Mozart threads can have priorities, see: http://www.mozart-oz.org/documentation/tutorial/node8.html#section.concurrency.priority which discusses exactly this point. cheers k _________________________________________________________________________________ mozart-users mailing list [email protected] http://www.mozart-oz.org/mailman/listinfo/mozart-users
