ParallelEnumerableには静的メンバーがありAsParallelます。があり、IEnumerable<T>使用したい場合Parallel.ForEach、それは常に使用する必要があることを意味しAsParallelますか?
例: これらはどちらも正しいですか (他のすべてが等しい)?
なしAsParallel:
List<string> list = new List<string>();
Parallel.ForEach<string>(GetFileList().Where(file => reader.Match(file)), f => list.Add(f));
またはAsParallel?
List<string> list = new List<string>();
Parallel.ForEach<string>(GetFileList().Where(file => reader.Match(file)).AsParallel(), f => list.Add(f));