From f50b19f93911328d43a4f441ebb69459d5be9670 Mon Sep 17 00:00:00 2001 From: Marcus Cuda Date: Fri, 21 Aug 2009 21:12:37 +0800 Subject: [PATCH] Parallel: added zero check, but aggregates still need fast forwards Signed-off-by: Marcus Cuda --- src/Numerics/Threading/Parallel.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Numerics/Threading/Parallel.cs b/src/Numerics/Threading/Parallel.cs index cbe6b3e6..9018d558 100644 --- a/src/Numerics/Threading/Parallel.cs +++ b/src/Numerics/Threading/Parallel.cs @@ -128,6 +128,16 @@ namespace MathNet.Numerics.Threading var tasks = new Task[ThreadQueue.ThreadCount]; var size = count / tasks.Length; + if (count <= 1) + { +// if (count == 1) + // { + // body(fromInclusive); + // } + + // return; + } + var intial = localInit(); // partition the jobs into separate sets for each but the last worked thread