Multi-processor support and .Net

Core support in Windows is tied to the notion of processor groups. For historical reason, a group is made of up to 64 cores (related to affinity mask).

Until version 4.0, .Net was only using first group (ref.), thus allowing up to 64 cores but statring with 4.5, .Net optionnaly support using more than one group for TPL as answered by Stephen Toub:

“The default TPL TaskScheduler targets the .NET ThreadPool.  By default, the pool is restricted to a single processor group (http://msdn.microsoft.com/en-us/library/windows/desktop/dd405503(v=vs.85).aspx), and thus to 64 cores.  However, in .NET 4.5 you can set the <Thread_UseAllCpuGroups enabled=”true”/> flag. When your computer has multiple CPU groups, enabling this element causes the runtime to distribute managed threads across all CPU groups rather than being limited to just one, and thus the default scheduler can target whatever the OS supports.  (GCCpuGroup must also be enabled for this setting to take effect.)”

This library can be usefull if more than 64 cores should be taken inti account: Multi-Processor Extensions for .NET – Home. This C++/CLI use umnanaged Win32 API to provide missing group informations.

Advertisements

await anything; – .NET Parallel Programming – Site Home – MSDN Blogs

Wants to really understand await/async:

  1. Async/Await FAQ,
  2. await anything; – .NET Parallel Programming – Site Home – MSDN Blogs,
  3. Implementing a simple ForEachAsync,
  4. Potential pitfalls to avoid when passing around async lambdas,
  5. Async Performance: Understanding the Costs of Async and Await,
  6. and “Building Async Coordination Primitives” series:

Not always easy to follow but rewarding.