{"id":3023,"date":"2007-11-29T04:30:00","date_gmt":"2007-11-29T04:30:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/pfxteam\/2007\/11\/29\/known-correctness-bugs-with-the-parallel-extensions-ctp-december-2007\/"},"modified":"2007-11-29T04:30:00","modified_gmt":"2007-11-29T04:30:00","slug":"known-correctness-bugs-with-the-parallel-extensions-ctp-december-2007","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/known-correctness-bugs-with-the-parallel-extensions-ctp-december-2007\/","title":{"rendered":"Known Correctness Bugs with the Parallel Extensions CTP December 2007"},"content":{"rendered":"<p>Here are known correctness bugs as of our December 2007 CTP release:<\/p>\n<ul>\n<li>Common <\/li>\n<ul>\n<li>The setup for Parallel Extensions may fail on Windows Server 2008 (both 32-bit and 64-bit).&nbsp; As a workaround, Parallel Extensions may be installed manually:<\/li>\n<ul>\n<li>From a prompt with administrator privileges: msiexec \/a ParallelExtensions_Dec07CTP.msi TARGETDIR=&#8221;%TMP%ParallelExtensions&#8221; \/qn \n<\/li>\n<li>This extracts the contents of the MSI to the target folder. The System.Threading.dll can be GAC&#8217;d manually from there using the gacutil tool.<\/li>\n<\/ul>\n<li>The spin waiting used in the libraries doesn&#8217;t always consider all runnable threads for switching due to dependency on SwitchToThread. \n<\/li>\n<li>AggregateException.Flatten should recursively flatten all AggregateExceptions such that the final output contains no aggregates.<\/li>\n<\/ul>\n<li>PLINQ \n<ul>\n<li>On an empty sequence, LINQ to Objects&#8217; Min\/Max will throw an exception whereas PLINQ&#8217;s will not. \n<\/li>\n<li>Calling Dispose on a PLINQ enumerator does not always properly dispose of resources allocated by the query. \n<\/li>\n<li>LINQ to Objects throws an exception when the predicate delegate passed to First is null; PLINQ does not. \n<\/li>\n<li>Max(double.NaN, null) is returned as null using PLINQ and double.NaN using LINQ to Objects. \n<\/li>\n<li>Calling Reset on an unopened enumerator throws a NullReferenceException. \n<\/li>\n<li>Cast with order-preservation enabled doesn&#8217;t&nbsp;handle invalid casts. \n<\/li>\n<li>ToArray(int[] lengths) does not handle dimension values of 0 correctly. \n<\/li>\n<li>Union throws IndexOutOfRangeException when order-preservation is enabled \n<\/li>\n<li>SkipWhile, TakeWhile, Select, SelectMany, Where incorrectly handle overflow conditions. \n<\/li>\n<li>TakeWhile followed by Take hangs or throws an out of memory exception when used on an infinite enumerable. \n<\/li>\n<li>Range incorrectly handles Int32.MaxValue. \n<\/li>\n<li>ToArray on a null source throws a NullReferenceException rather than an ArgumentNullException as in LINQ to Objects. \n<\/li>\n<li>No verification is performed on the PLINQ_DOP\/PLINQ_PRESERVE_ORDER environment variables before parsing them. \n<\/li>\n<li>Range partitioning fairness needs to be improved.&nbsp; In certain cases, threads will be starved of work. For example, if input.Count = 9 and DOP = 8, PLINQ will partition input into partitions of sizes {2,2,2,2,1,0,0,0} instead of {2,1,1,1,1,1,1,1}. \n<\/li>\n<li>SelectMany may throw out of memory exceptions for medium-to-large sized data sources. \n<\/li>\n<li>PLINQ is designed to wrap all exceptions thrown from a query in an AggregateException, but sometimes unwrapped exceptions may escape.<\/li>\n<\/ul>\n<\/li>\n<li>Task Parallel Library <\/li>\n<ul>\n<li>A rare race condition exists that causes some task joins to be missed. \n<\/li>\n<li>The Value property on a Future&lt;T&gt; created with the parameterless Create method is supposed to block in its get accessor until the Value property has been set, but it doesn&#8217;t. \n<\/li>\n<li>Worker threads are not cleaned up when the associated task manager is disposed. \n<\/li>\n<li>Tasks blocked for significant periods of time may cause runaway thread injection and out of memory conditions when the default policy is used. \n<\/li>\n<li>Task.CancelAndWait is supposed to eat the TaskCanceledException for the task being canceled, but it&#8217;s currently not doing so. \n<\/li>\n<li>TaskManager(TaskManagerPolicy) should demand Infrastructure permission, not ControlEvidence and ControlPolicy. \n<\/li>\n<li>The implementation of Task.Completed is incorrect and can lead to a completion handler being invoked more than once. \n<\/li>\n<li>TaskCoordinator.WaitAll only works with Task[] (and not TaskCoordinator[] as documented and as exposed through the API).&nbsp; This means it can&#8217;t currently be used with parameter arrays. \n<\/li>\n<li>Task.IsCompleted may throw a NullReferenceException when used with self-replicating tasks. \n<\/li>\n<li>TaskManager fails to initialize if execution context flow already suppressed. \n<\/li>\n<li>Parallel.Do will hang if the associated TaskManager has been shutdown. \n<\/li>\n<li>Task.Create(Action, string) conflicts with Task.Create(Action, object), in that a user may try to provide a string as the state to the action, but will end up naming the task instead.<\/li>\n<li>ExecutionContext is not flowed correct through&nbsp;some asynchronous points<\/li>\n<li>The threadLocalCleanup delegate provided to Parallel.ForEach may not be called.&nbsp;<\/li>\n<\/ul>\n<li>Samples<\/li>\n<ul>\n<li>Most of the samples included with the CTP&nbsp;reference the wrong version number of System.Threading.dll, which will prevent the samples from compiling\/executing.&nbsp; A simple workaround is to remove the System.Threading reference from the sample project and then readd the reference.<\/li>\n<\/ul>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Here are known correctness bugs as of our December 2007 CTP release: Common The setup for Parallel Extensions may fail on Windows Server 2008 (both 32-bit and 64-bit).&nbsp; As a workaround, Parallel Extensions may be installed manually: From a prompt with administrator privileges: msiexec \/a ParallelExtensions_Dec07CTP.msi TARGETDIR=&#8221;%TMP%ParallelExtensions&#8221; \/qn This extracts the contents of the MSI [&hellip;]<\/p>\n","protected":false},"author":360,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7908],"tags":[7909,7910,7912],"class_list":["post-3023","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pfxteam","tag-parallel-extensions","tag-plinq","tag-task-parallel-library"],"acf":[],"blog_post_summary":"<p>Here are known correctness bugs as of our December 2007 CTP release: Common The setup for Parallel Extensions may fail on Windows Server 2008 (both 32-bit and 64-bit).&nbsp; As a workaround, Parallel Extensions may be installed manually: From a prompt with administrator privileges: msiexec \/a ParallelExtensions_Dec07CTP.msi TARGETDIR=&#8221;%TMP%ParallelExtensions&#8221; \/qn This extracts the contents of the MSI [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3023","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/360"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=3023"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/3023\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=3023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=3023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=3023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}