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
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

751 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