foreach (i; taskPool.parallel(0..2_000_000)

Paul phshaffer at gmail.com
Sat Apr 1 22:30:06 UTC 2023


> ```d
> import std.range;
>
> foreach(; iota(0, 2_000_000).parallel)
> ```
>
> -Steve

Is there a way to verify that it split up the work in to 
tasks/threads ...?  The example you gave me works...compiles w/o 
errors but the execution time is the same as the non-parallel 
version.  They both take about 6 secs to execute.  totalCPUs 
tells me I have 8 CPUs available.



More information about the Digitalmars-d-learn mailing list