Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 51465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:45:17+00:00 2026-05-10T16:45:17+00:00

How do you detect the number of physical processors/cores in .net?

  • 0

How do you detect the number of physical processors/cores in .net?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:45:17+00:00Added an answer on May 10, 2026 at 4:45 pm
    System.Environment.ProcessorCount 

    returns the number of logical processors

    http://msdn.microsoft.com/en-us/library/system.environment.processorcount.aspx

    For physical processor count you’d probably need to use WMI – the following metadata is supported in XP/Win2k3 upwards (Functionality enabled in SP’s prior to Vista/Win2k8).

    Win32_ComputerSystem.NumberOfProcessors returns physical count

    Win32_ComputerSystem.NumberOfLogicalProcessors returns logical (duh!)

    Be cautious that HyperThreaded CPUs appear identical to multicore’d CPU’s yet the performance characteristics are very different.

    To check for HT-enabled CPUs examine each instance of Win32_Processor and compare these two properties.

    Win32_Processor.NumberOfLogicalProcessors

    Win32_Processor.NumberOfCores

    On multicore systems these are typically the same the value.

    Also, be aware of systems that may have multiple Processor Groups, which is often seen on computers with a large number of processors. By default .Net will only using the first processor group – which means that by default, threads will utilize only CPUs from the first processor group, and Environment.ProcessorCount will return only the number of CPUs in this group. According to Alastair Maw’s answer, this behavior can be changed by altering the app.config as follows:

    <configuration>    <runtime>       <Thread_UseAllCpuGroups enabled='true'/>       <GCCpuGroup enabled='true'/>       <gcServer enabled='true'/>    </runtime> </configuration> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Programatically detect number of physical processors/cores or if hyper-threading is active on
Is there a platform independent way to detect the number of physical and/or virtual
Will LINQ's parallel extensions automatically detect the number of cores and utilize them all?
I'm trying to detect the number of non-HyperThreading cores on a machine using a
I have to call phone number and detect if the modem at the opposite
I've read a number of posts regarding how to detect shakes but I'm not
How to detect if a string contains at least a number (digit) in SQL
Are there any HTTP headers one can use to detect a mobile users number
To detect rotation of the mouse wheel in .NET/WinForms, I can override OnMouseWheel .
If I want to detect the number of connections active on my home Wifi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.