3 ms·
Similar to mietek's Haskell example, .NET 4.0 offers an easy way to parallelize for loops using the Parallel.For method in System.Threading.Tasks [1]. Parall
by alanning 15y ago
Similar to mietek's Haskell example, .NET 4.0 offers an easy way to parallelize for loops using the Parallel.For method in System.Threading.Tasks [1].
Parallel.For(0, N, i =>
{
// Do Work.
});
This link has a simple performance comparison: [2]
[1] http://msdn.microsoft.com/en-us/library/system.threading.tasks.parallel.aspx http://msdn.microsoft.com/en-us/library/system.threading.tas...
[2] http://www.lovethedot.net/2010/02/parallel-programming-in-net-40-and.html http://www.lovethedot.net/2010/02/parallel-programming-in-ne...