Solved

How can one find out that a process (or one of its threads) is running on a specific processor in a multiprocessor machine.

Posted on 2004-08-18
3
167 Views
Last Modified: 2010-04-15
Lets assume, I am working on a multiprocessor machine, which I am.

I use,
    Process.GetCurrentProcess().Affinity = 2; //Or something similar to this.
Now, All I need to know how would I be able to identify programatically that this process would be running on the 2nd CPU.

Given that, I can use a ManagementObject with Win32_Processor.DeviceID, how would one prove (programatically) that a particular process or one of its threads is defintely running on an assigned processor. Are there any alternatives other than ManagementObject class?
0
Comment
Question by:urxlnc
3 Comments
 
LVL 3

Accepted Solution

by:
bigjim2000 earned 50 total points
ID: 11838743
Well, in a multi-processor environment, generally a process is running on BOTH CPU's, just not at the same time.  Open up your task manager and run an application and look at the CPU Usage History graphs for both CPU's.  They will both be spiking around, just not at the same time.

So, I guess what I'm saying, is that there really isn't a way (at least that I can even remotely start to imagine) to do this.

Just out of curiosity, can I ask what you need this information for?

-Eric
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question