Tone <
tss...@iinet.net.au> wrote in news:xp-dnSntpulvPZjKnZ2dnUU7-
afN...@westnet.com.au:
> Be aware that these days PROCESSORSTATUS returns 16 as the number of
> CPUs regardless of how many actually exist in the system. So, on a 2
> processor system it would show 0 and 1 as up and 2 through 15 as down
> (or missing).
Are you sure about that?
PROCESSORSTATUS normally would return the number of the highest *configured*
processor, plus 1, without regard to the number of processors *installed*. The obvious
reason for this is that the software doesn't have any way of distinguishing between a
processor that is configured, installed, and down, and a processor that is configured but not
installed.
It also returns a one-word (16-bit) mask showing which processor(s) are installed and up (1)
or down/not installed (0).
Perhaps the system you're working on has 16 processors configured even if you don't have
that many installed.
In any event, this isn't really relevant to the OP's question, since a process obviously can
be running only in a CPU that is configured, installed, and up (1-bit in the mask). So the OP
needs check only the processor(s) whose numbers have a 1-bit in the mask, without regard
to how many are configured or installed.