12Aug/100
Parallel.For – Multithreading has never been so easy
In the last version C# there is the possibility zrównoleglenia calculations in a very simple way. Loop:
for (int n = 0; n < 8; n++) { Console.WriteLine("Normal - iteracja {0} wątek {1}", n, Thread.CurrentThread.ManagedThreadId); }
can be replaced by the following structure:
Parallel.For(0, 8, i => { Console.WriteLine("Parallel - iteracja {0} wątek {1}", i, Thread.CurrentThread.ManagedThreadId); });








