title: Mono: Problems with Parallel.For
body: <p>I'm using <code>Task.Parallel</code> class from the <strong>Microsoft Reactive Extensions</strong> (the <strong>.NET 3.5 library</strong>, not the ones from .NET 4, since my app is running on 3.5). Everything works fine on .NET, but when I run it in Mono (2.10.5, on Linux), it throws an exception when calling the <code>Parallel.For()</code> method:</p>
  
  <pre><code>System.Threading.Tasks.TaskSchedulerException: TaskSchedulerException_ctor_DefaultMessage 
   ---&gt; System.EntryPointNotFoundException: SwitchToThread
   at (wrapper managed-to-native) System.Threading.Platform:SwitchToThread ()
   at System.Threading.Platform.Yield () [0x00000] in &lt;filename unknown&gt;:0
   at System.Threading.ManualResetEventSlim.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00000] in &lt;filename unknown&gt;:0
   at System.Threading.ManualResetEventSlim.Wait () [0x00000] in &lt;filename unknown&gt;:0
   at System.Threading.Tasks.Task.InternalRunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in &lt;filename unknown&gt;:0
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.InternalRunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in &lt;filename unknown&gt;:0
   at System.Threading.Tasks.Task.RunSynchronously (System.Threading.Tasks.TaskScheduler scheduler) [0x00000] in &lt;filename unknown&gt;:0
   at System.Threading.Tasks.Parallel.ForWorker[Object] (Int32 fromInclusive, Int32 toExclusive, System.Threading.Tasks.ParallelOptions parallelOptions, System.Action`1 body, System.Action`2 bodyWithState, System.Func`4 bodyWithLocal, System.Func`1 localInit, System.Action`1 localFinally) [0x00000] in &lt;filename unknown&gt;:0
  </code></pre>
  
  <p>I couldn't find any resources on the Web covering this exception, so I'm kind of stuck. Any suggestions? Does Task Parallel library for 3.5 run at all on Mono?</p>