linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How can I know the number of current users in the system?
@ 2001-11-04 22:15 Wei Xiaoliang
  2001-11-05  7:47 ` Riley Williams
  2001-11-06  9:28 ` Terje Eggestad
  0 siblings, 2 replies; 9+ messages in thread
From: Wei Xiaoliang @ 2001-11-04 22:15 UTC (permalink / raw)
  To: mlist-linux-kernel

Hi every one,
    I have a problem not clear: Is there any counter for the user number
in linux?
I want to do anexperiment which will get the number of current user in
the system and try fair-share scheduling based on it. I read the sys.c
and user.c but cannot find a counter for it. Is there any counter for
this things?

    If no, where can I put the inc instruct and dec instruct  or the
counter? in the uid_hash_insert and uid_hash_remove?
    Thank you!
-----------------------------------------------------------------------
Xiaoliang (David) Wei                    Graduate Student in CS, Caltech
E-mail: weixl@caltech.edu                Office: 158 Jorgensen
Phone: 1-(626)-395-3555 (O)        1-(626)-577-5238 (H)
Mail:     Xiaoliang Wei, 256-80 Caltech, Pasadena, CA 91125, U.S.A.
WWW: http://www.cs.caltech.edu/~weixl    http://166.111.69.241/~wxl
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: How can I know the number of current users in the system?
@ 2001-11-06 12:38 Nicholas Berry
  0 siblings, 0 replies; 9+ messages in thread
From: Nicholas Berry @ 2001-11-06 12:38 UTC (permalink / raw)
  To: terje.eggestad, amon; +Cc: weixl, mlist-linux-kernel

It depends whether you're looking for an idea of who's on, or you want a definitive count. The lattter is basically almost impossible. What if a logged-in user nohups two xterms to different X-servers, then logs out - how many people are logged in? I've spent a hell of a long time working on this on AIX for a certain German bank, and the bottom line is that it can't be done. What is 'logged on' anyway? Someone running bash or ksh, that's cool, but what about someone running /home/fred/myprog? Is it a shell?

Basically once Unix went beyond serial terminals connected to dumb serial ports, we lost the ability to track users.

Nik


> Hmmm, you should be able to count the number of pty's and tty's.
> Every logged in user is attached to some sort of getty
> whose parent is the init task (1). That might be a basis for
> a count.



^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <sbe793a0.090@mail-01.med.umich.edu>]
* Re: How can I know the number of current users in the system?
@ 2001-11-06 14:21 Telford002
  0 siblings, 0 replies; 9+ messages in thread
From: Telford002 @ 2001-11-06 14:21 UTC (permalink / raw)
  To: nikberry, terje.eggestad, amon; +Cc: weixl, mlist-linux-kernel

In a message dated 11/6/01 8:01:08 AM Eastern Standard Time, 
nikberry@med.umich.edu writes:

> Basically once Unix went beyond serial terminals connected to dumb serial 
> ports, we lost the ability to track users.

I would have phrased the comment somewhat different.

Once Unix adopted the process and file I/O abstraction,
a system wide user count became meaningless.

Unix should be contrasted with Primos or VMS where the
user memory space or program and serial terminal I/O 
are used in defining the multiuser time-sharing capabilities
of the system.

Joachim Martillo

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-11-06 14:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-04 22:15 How can I know the number of current users in the system? Wei Xiaoliang
2001-11-05  7:47 ` Riley Williams
2001-11-06  1:20   ` Chris Abbey
2001-11-06  9:28 ` Terje Eggestad
2001-11-06 12:03   ` Dale Amon
2001-11-06 12:38 Nicholas Berry
     [not found] <sbe793a0.090@mail-01.med.umich.edu>
2001-11-06 13:44 ` Terje Eggestad
2001-11-06 14:40   ` Richard B. Johnson
2001-11-06 14:21 Telford002

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).