Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to find process name/ID of a running object?

118 views
Skip to first unread message

pta...@gmail.com

unread,
Apr 6, 2016, 12:04:43 AM4/6/16
to
Hi,

I would like to list all process names/ID's of a particular object file and perform certain operations on those processes, such altering their priorities via a program.

I tried process_getinfo_, but I found the result is similar to what I get from a "fup listopens". What I need is "status *, prog <objfilename>.

After many attempts, I tried using file_getopeninfo_ as well. But it works fine for data file and not for object files.

Any suggestions ?

Tone

unread,
Apr 6, 2016, 12:49:30 AM4/6/16
to
Check out PROCESS_GETINFOLIST_ as it allows search criteria. There is a
section in chapter 16 of the Guardian Programmers Guide on "Getting List
Information About Multiple Processes" which may be helpful.

wbreidbach

unread,
Apr 6, 2016, 1:08:00 AM4/6/16
to
I agree that PROCESS_GETINFOLIST_ is the procedure of choice. Please regard that the use of this procedure to find all processes with a given search criteria is a bit tricky. There are 2 things: Even if the call succeeds the returncode might not be 0, it will very likely be 4. The next thing is that you have to search all CPUs for those processes. You can get the number of installed CPUs using PROCESSOR_GETINFOLIST_.

red floyd

unread,
Apr 6, 2016, 1:07:43 PM4/6/16
to
Wouldn't you prefer PROCESSORSTATUS, as there may be gaps in the CPUs?
e.g. 0,1,4,5 is 4 CPUs, but the maximum CPU number is 5.

Tone

unread,
Apr 6, 2016, 7:51:16 PM4/6/16
to
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).

Doug Miller

unread,
Apr 6, 2016, 11:15:06 PM4/6/16
to
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.

wbreidbach

unread,
Apr 7, 2016, 5:51:02 AM4/7/16
to
PROCESSOR_GETINFOLIST_ can return the number of physically installed CPUs (82) and that is what I was referring to. Of course you have to check if the CPU is up, PROCESSORSTATUS is a pretty good solution for that.

Tone

unread,
Apr 7, 2016, 5:57:55 AM4/7/16
to
Not as sure as before I read your post :-(

I had checked a range of different lab systems (G, H, J and L) before
responding and they all showed 16 processors. I'll have to check with
the hardware guys to see if they (very optimistically) configured these
systems for 16 processors.

Doug Miller

unread,
Apr 7, 2016, 8:02:14 PM4/7/16
to
Tone <tss...@iinet.net.au> wrote in news:JLudnQYUBu-_spvKnZ2dnUU7-
ced...@westnet.com.au:

> I had checked a range of different lab systems (G, H, J and L) before
> responding and they all showed 16 processors. I'll have to check with
> the hardware guys to see if they (very optimistically) configured these
> systems for 16 processors.

It's not unusual for a system manager to configure a few more processors than physically exist
in the system; that way, if budget money becomes available to purchase more processors, all
that needs to be done to bring them online is to physically install them and apply power -- no
sysgen needed.

You may not have to check with the hardware guys to see what's configured: look for
$SYSTEM.SYSnn.CONFTEXT.

Tone

unread,
Apr 7, 2016, 11:10:14 PM4/7/16
to
Showing your age/experience :-) The specification of number of
processors in the ALLPROCESSORS paragraph of CONFTEXT existed in
D-series but was removed in G-series and later ones. According to a
harware guy I spoke to, on G-series hardware there was a topology of 8
or 16 CPUs that may have influenced the configured number of processors
but he is not aware of an option for later systems to specify the
physical number of processors. I suspect the OS now defaults to 16 so
that processors can be added without the need for sysgen (as you mentioned).
0 new messages