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
165 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now