Monday, 12 August 2019

windows - Determine which CPU a process is running on


Using Sysinternals' Process Explorer, is there a column that can be used to indicate which CPU a process is running on? If no column, is there some other way?



Answer



Requested in 2005:



I am very impressed with the features integrated in Process Explorer but would like to see an option to display each process CPU affinity in the main window as a column toggle.



No response.


Requested in 2007:



Thanks for superb utilities. My request is to add a column option to process explorer to display CPU affinity. That's it.



No response.


Similar discussed in 2013:



It would be really nice if there were a new Process Performance View Column called Core Usage that would show a sum of the usage over the core that the process is running on.



Basic synopsis: It can't be done.


Threads are what are sent to cores for processing, not processes. Most modern processes have multiple threads.


If you manually set the affinity for a process, then all threads for the process should stick to a single processor. Since you manually set it, you should know which CPU it's on. ;)


But if you don't specify, then the thread(s) will be controlled by the OS and underlying processing hardware, and would jump around between processors at a speed that would be unwatchable, and very likely inaccurate by the time it was displayed to you.


Perhaps check out these SU question for more:



Also, from StackOverflow:



Now if you wrote the program, you could use the GetCurrentProcessorNumber, which reports the current processor in use by the thread from which the function was called.


Using this will allow you to make estimations about processor usage by your threads, as you can never be sure where the threads will be one cycle to the next (again, unless you set the affinity on purpose).


More info:



No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...