Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* determining load average
@ 1999-07-14  4:00 Paul Bourke
  1999-07-14  4:00 ` Hal Murray
  1999-07-15  4:00 ` Usman Muzaffar
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Bourke @ 1999-07-14  4:00 UTC (permalink / raw)


How does one getting the machine load? I'm about to do some parallel
animations on a Dec farm (UNIX) and would like to check the load from 
my C source and not use that machine if the load is too high. Sure
I can system("uptime") and parse the result....yuk. Surely there's
a cleaner "standard" way?
-- 
                  -----------------------------
                  P a u l   B o u r k e
                  mailto:pbourke@swin.edu.au
                  http://www.mhri.edu.au/~pdb/
                  Phone: 61 3 9214 5828
                  Fax:   61 3 9819 0856
                  -----------------------------



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

* Re: determining load average
  1999-07-14  4:00 determining load average Paul Bourke
@ 1999-07-14  4:00 ` Hal Murray
  1999-07-15  4:00 ` Usman Muzaffar
  1 sibling, 0 replies; 4+ messages in thread
From: Hal Murray @ 1999-07-14  4:00 UTC (permalink / raw)



> How does one getting the machine load? I'm about to do some parallel
> animations on a Dec farm (UNIX) and would like to check the load from 
> my C source and not use that machine if the load is too high.

One good trick for things like that is to scan the sources for top
and/or monitor.  They are out on http://ftp.digital.com/

Go to Serach the Archive, enter top or monitor, and
scan until you find something that looks right.

  /pub/DEC/monitor.tar.Z
  /pub/DEC/monitor.alpha.tar.Z

  /pub/DEC/top.alpha.bin
  /pub/DEC/top.tar.Z
-- 
These are my opinions, not necessarily my employers.



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

* Re: determining load average
  1999-07-14  4:00 determining load average Paul Bourke
  1999-07-14  4:00 ` Hal Murray
@ 1999-07-15  4:00 ` Usman Muzaffar
  1999-07-16  4:00   ` Joerg Czeranski
  1 sibling, 1 reply; 4+ messages in thread
From: Usman Muzaffar @ 1999-07-15  4:00 UTC (permalink / raw)


Paul Bourke wrote:
> 
> How does one getting the machine load? I'm about to do some parallel
> animations on a Dec farm (UNIX) and would like to check the load from
> my C source and not use that machine if the load is too high. Sure
> I can system("uptime") and parse the result....yuk. Surely there's
> a cleaner "standard" way?

As I understand it, things about process information are more or
less guaranteed to be *different* between different operating systems,
which is why there is no POSIXish way to get at process information
at the lower level. I'm no fan of system() in C programs either, but
I'd guess in this case, uptime is the best way to go.

But if anyone knows differently, please, let's hear it.
-usman



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

* Re: determining load average
  1999-07-15  4:00 ` Usman Muzaffar
@ 1999-07-16  4:00   ` Joerg Czeranski
  0 siblings, 0 replies; 4+ messages in thread
From: Joerg Czeranski @ 1999-07-16  4:00 UTC (permalink / raw)


Usman Muzaffar wrote in <378E75EC.5493938@thynne.psych.nwux.edu>:
> Paul Bourke wrote:
> > 
> > How does one getting the machine load? I'm about to do some parallel
> > animations on a Dec farm (UNIX) and would like to check the load from
> > my C source and not use that machine if the load is too high. Sure
> > I can system("uptime") and parse the result....yuk. Surely there's
> > a cleaner "standard" way?
> 
> As I understand it, things about process information are more or
> less guaranteed to be *different* between different operating systems,
> which is why there is no POSIXish way to get at process information
> at the lower level. I'm no fan of system() in C programs either, but
> I'd guess in this case, uptime is the best way to go.
> 
> But if anyone knows differently, please, let's hear it.
> -usman

If the solution is allowed to be Dec Unix specific, using
table(TBL_LOADAVG, ...) is probably much more efficient than
system("uptime") (or rather popen("uptime", "r")).

I don't think there's a portable way without spawning uptime.
Actually neither uptime nor w are Posix or XPG4, but I don't know
a Unix that lacks them.

joerch



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

end of thread, other threads:[~1999-07-16  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-14  4:00 determining load average Paul Bourke
1999-07-14  4:00 ` Hal Murray
1999-07-15  4:00 ` Usman Muzaffar
1999-07-16  4:00   ` Joerg Czeranski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox