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?

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to