[Swift-devel] Re: Heap space being exhausted

Allan Espinosa aespinosa at cs.uchicago.edu
Thu Jun 3 19:07:30 CDT 2010


I see. so in this workflow there will be a slow start:

foreach ai,i in a[] {
  y[i] = f(x[i]);
  foreach bj,j in b[] {
     z[j] = g(y[i], bj);
  }
}

at the start the number of threads will be <= maxthreads, then when
some y[i]'s become available there will now be maxthreads*maxthreads
threads running.

2010/6/3 Mihael Hategan <hategan at mcs.anl.gov>:
> On Wed, 2010-06-02 at 21:47 -0500, Allan Espinosa wrote:
>> Ahhh, I always thought its for all the foreach statemtns.
>
> No. That would open the door to unpredictable deadlocks. Imagine
> consumer and producer, consumer filling the thread count and waiting on
> data from producer who would be unable to produce because of the thread
> limit.



More information about the Swift-devel mailing list