WTF! Parallel foreach more slower that normal foreach in multicore CPU ?

Piotr Szturmaj bncrbme at jadamspam.pl
Thu Jun 23 06:20:14 PDT 2011


Zardoz wrote:
> 		const num = 10;
 >
> 		foreach (t; 0..num) {
>
> 	    foreach(i, ref elem; taskPool.parallel(logs, 100)) {
> 	        elem = log(i + 1.0);
> 	    }
>
>      }

I think you just spawned 10 tasks. Look at foreach (t; 0..num).


More information about the Digitalmars-d-learn mailing list