in reply to Re: resource control: CPU
in thread resource control: CPU

I think it will be more clever, if somebody research how to do this on *BSD and other systems and send to me patch. ;-)
And I'm sorry - I'm working only with Linux many years and I don't keep in mind portability problems... :(

Update: I'm found nice standart function times() which can do something like my CPU_used() and I think it is possible to rewrite CPU_used() without using /proc/ now!

Replies are listed 'Best First'.
Re: Re: Re: resource control: CPU
by thayer (Sexton) on Apr 30, 2002 at 07:20 UTC
    times() is good within an particular (unix-ish) environment, but generally gives you clock ticks. Unfortunately those clock ticks may vary for different hardware and for different OSes depending on the jiffy (quantum) size, the CPU speed, and the power saving facilities...

    Don't get me wrong, it's still probably a 99% solution to what you were trying to do.