+ Reply to Thread
Results 1 to 2 of 2

Thread: How to get number of cores on my machine programmatically?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    49

    How to get number of cores on my machine programmatically?

    I am creating a multi-threading application.

    I want to create as many thread as there are umber of cores on machine.

    How to get number of cores on my machine programmatically?

  2. #2
    GetSystemInfo API can be useful to you.

    Example:

    Code:
    int GetNumberOfCores()
    {
    	SYSTEM_INFO objSystemInfo ;
    	GetSystemInfo(&objSystemInfo) ;
    
    	return objSystemInfo.dwNumberOfProcessors ;
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts