I am a novice in multithreading programing. I have a dual-CPU PC and I try to get the number of the CPU via the function:"CmtGetNumProcessor". Theoretically, I only have two numbers of the CPU, but I got four numbers after several check. I am confused about this phenomenon. The following is my code:
int Num,ID,CID;
int main (int argc, char *argv[])
{
//get the number of CPU which process the program
Num = CmtGetNumProcessors ();
printf("The number of CPU: %d \n",&Num);
//Returns the ID of the main thread of the program
ID = CmtGetMainThreadID ();
printf("The ID of the main thread of the program: %d \n",&ID);
//Returns the ID of the current thread
CID = CmtGetCurrentThreadID ();
printf("The ID of the current thread of the program: %d \n",&CID);
getchar();
return;
}
Thank you