T.R | Title | User | Personal Name | Date | Lines |
---|
280.1 | sorted by PID? | GVASA::REGINA | Regina Haase-Rohr, IS Geneva | Mon Aug 04 1986 12:41 | 5 |
| I sometimes got the impression that phone dir displays first logged-in
first in the list. Could it be?
rhr
|
280.2 | PHONE is lazy... | WHOARU::MCCARTHY | Error Message #000000 | Mon Aug 04 1986 13:54 | 13 |
|
The PHONE utility does it the easy way! What I mean by that is
it uses the system process id numbers. Which, by the way, are in order
of logins.
The $GETJPI system service which will, upon repeated calls, return
the pid of the next process. I wrote a program in PASCAL that used $GETJPI
to check for process that had terminals. PHONE may do the same thing. I
have since added a sort routine to the program because, well, it looks better
(and too may complaints).
Brian
|
280.3 | | CAFEIN::PFAU | I brake for ferrets | Mon Aug 04 1986 22:41 | 33 |
| PID's are NOT returned in the order of login. PID's have the same
format on V4 as they had on V3 (more or less). They are composed
of an index and a use count (plus cluster node information if the
system is part of a cluster). The low order bits make up the index.
The number of bits used for the index varies depending on
MAXPROCESSCNT.
When a user logs in, the first available process slot (the one with
the lowest index) is used. The use count for that slot is incremented.
For example, assume MAXPROCESSCNT = 16 (^X10). Four bits will be used
for the index. NULL = 10, SWAPPER = 11, SYSINIT gets 12, JOB_CONTROL
gets 13, SYSINIT logs out. First user (USERA) gets 22 (slot 2, second
process to use that slot). Second user (USERB) gets 14. Third
user (USERC) gets 15. USERB logs out. Fourth user (USERD) gets
24. $GETJPI will return processes in the following order:
10 (NULL)
11 (SWAPPER)
22 (USERA)
13 (JOB_CONTROL)
24 (USERD)
15 (USERC)
This is neither alphabetical nor in order of login.
Both PHONE and SHOW USERS use $GETJPI to find out who's logged in.
SHOW USERS sorts the information before display, PHONE doesn't.
Since SHOW USERS has to collect all the information first in order
to sort it, it can display a count of users at the top of the list.
PHONE counts and displays as it goes so the count is at the end.
tom_p
|
280.4 | slightly wrong | JON::MORONEY | Madman | Mon Aug 04 1986 23:54 | 11 |
| re .3: Minor correction: It's not the _first_ free process slot that gets
used - it is the _next available slot_ after the last created process. In other
words, in the example given, the first user (USERA) will get 14, the next
(USERB) will get 15, and so on thru 1F. The next user will get 22 (since
SYSINIT logged out), and if the only other one to log out in this time is the
person who got # 19, the next user will get 29. This was just verified by
several $ SPAWN SHOW SYSTEMs in rapid succession on an unloaded system.
Perhaps it is done this way to be sure all process slots wear evenly? :-)
-Mike
|
280.5 | Thank you for the correction | WHOARU::MCCARTHY | Error Message #000000 | Tue Aug 05 1986 09:02 | 6 |
|
Sorry about the incorrect info on PID's. It has been a while since
I played with that stuff. I relized my error last night.
An ex-system hacker (school),
Brian
|
280.6 | | ERIS::CALLAS | Jon Callas | Tue Aug 05 1986 11:09 | 10 |
| The first available slot was how it was done before V4, so don't feel
bad.
The new scheme is done precisely so that the slots wear more evenly
(beleive it or not). The reason is that you want PIDs to be (mostly)
unique. You don't want any confusion about pids. The new scheme ensures
that it will take longer for the pid count to roll over and two
processes have the name pid.
Jon
|
280.7 | | CAFEIN::PFAU | I brake for ferrets | Tue Aug 05 1986 17:55 | 5 |
| That's interesting. I had never noticed that. It does sound logical,
though, to start the search for a free slot from the last slot used
instead of from the top.
tom_p
|