Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: Joerg Czeranski <jc@joerch.org>
Subject: Re: determining load average
Date: 1999/07/16	[thread overview]
Message-ID: <5wVQxinBA$5e4$1@joerch.org> (raw)
In-Reply-To: 378E75EC.5493938@thynne.psych.nwux.edu

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



      reply	other threads:[~1999-07-16  4:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]
read-only archive

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