From 6f5c57266c8911b02e0e73812ade000164e4abf9 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 31 Aug 2010 19:03:32 +0200 Subject: [PATCH] Pass ParallelOptions to Parallel.ForEach in LoadSolutionProjectsThread --- .../Project/Src/Services/ParserService/ParseProjectContent.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs b/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs index b5d57b6efc..aada628be3 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ParseProjectContent.cs @@ -274,6 +274,10 @@ namespace ICSharpCode.SharpDevelop double fileCountInverse = 1.0 / fileContents.Count; Parallel.ForEach( fileContents, + new ParallelOptions { + MaxDegreeOfParallelism = Environment.ProcessorCount * 2, + CancellationToken = progressMonitor.CancellationToken + }, fileName => { // Don't read files we don't have a parser for. // This avoids loading huge files (e.g. sdps) when we have no intention of parsing them.