Brian Edmonds (brian@gweep.bc.ca)
Sun, 23 May 1999 16:55:41 -0700
hansen wang <hansenw@ece.ubc.ca> writes:
> Does anyone know how to identify which CPU a process is running on,
> say CPU1 or CPU0 on dual processor machine.
I don't know of any way to do this, and even if there were some way,
it's unlikely to be meaningful. Linux does not support processor
affinity[1], so by the time the kernel tells you what processor you're
running on, you may have switched to the other one.
Brian.
[1] The ability to force a particular process to always run on a
particular processor. Linux *tends* to run the process on the same
processor, but there's no guarantee. I can watch (with xosview) a CPU
intensive process switch back and forth every few seconds between my two
processors.
This archive was generated by hypermail 2.0b3 on Sun 23 May 1999 - 16:56:33 PDT