On 3/6/11 10:44 AM, Russel Winder wrote:
If I do:

   auto tasks = new Tid[numberOfTasks] ;
   foreach ( i ; 0 .. numberOfTasks ) { tasks[i] = spawn (&  partialSum , 
thisTid , i , sliceSize , delta ) ; }

everything workls as desired, I get parallelism and appropriate scaling.
However if I try:

   auto tasks = map ! ( ( i ) { return spawn (&  partialSum , thisTid , i , 
sliceSize , delta ) ; } ) ( iota ( numberOfTasks ) ) ;

the code runs but everything is serialized, no parallelism, no speed up.

I would say this is a bug, but perhaps it is a consequence of the way map works?

I doubt the code ever runs - map is lazy.

Andrei

Reply via email to