58
1
using System;
2
using System.IO;
3
using System.Collections;
4
using System.Collections.Generic;
5
using System.Linq;
6
using System.Threading;
7
using System.Threading.Tasks;
8
9
10
11
public class Program
12
{
13
public static void Main()
14
{
15
//SimpleParallelFor();
16
ParallelForWithThreadLocalVariables();
17
}
18
19
private static void SimpleParallelFor()
20
{
21
ParallelLoopResult result = Parallel.For(0, 100, index => CalculateSum(index));
22
Console.WriteLine(result.IsCompleted);
23
}
24
Cached Result
aN uPERCASE tEST sTRING! hERE aRE sOME mORE wORDS
An UPERCASe TESt STRINg! HERe ARe SOMe MORe WORDs
an uPERCASe tESt sTRINg! hERe aRe sOMe mORe wORDs
An UPERCASe TESt STRINg! HERe ARe SOMe MORe WORDs
an uPERCASe tESt sTRINg! hERe aRe sOMe mORe wORDs