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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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