Re: can I force a parallel foreach to finish?

2011-07-25 Thread Steven Schveighoffer
On Fri, 22 Jul 2011 18:38:15 -0400, McAnany, Charles E wrote: Hi, all. So I'm getting the classic "concurrency noob" behavior from this code: shared int times; int[] iterationRange = new int[2500]; foreach (pos, ref i; parallel(iterationRange)){ times++; } write

can I force a parallel foreach to finish?

2011-07-22 Thread McAnany, Charles E
Hi, all. So I'm getting the classic "concurrency noob" behavior from this code: shared int times; int[] iterationRange = new int[2500]; foreach (pos, ref i; parallel(iterationRange)){ times++; } writeln(times); } Prints random numbers near 1,000. Looking at the docu