On 2013-02-09 23:32, Sparsh Mittal wrote:
I saw foreach and parallel commands on
http://dlang.org/phobos/std_parallelism.html

I have nested for-loops as follows:

for(int i=1; i< N; i++)
  {
   for(int j=1; j < M; j++)
    {
      func(i,j);
    }
  }

Here func(i,j) is such that there is no dependency or communication b/w
different (i,j) tuple values. Thus, problem is very simple.

Huh?
for(int i=1; i< N; i++)    <==>    foreach(i; iota(1, N))
so you can use:  foreach(i; parallel(iota(1, N))) { ... }

Reply via email to