
----- Original Message ----- From: "Beman Dawes" <bdawes@acm.org> To: <boost@lists.boost.org> Sent: Tuesday, November 18, 2008 11:03 PM Subject: Re: [boost] [Chrono] Proposed library now feature complete
On Tue, Nov 18, 2008 at 1:40 PM, vicente.botet <vicente.botet@wanadoo.fr> wrote:
As you have started to add other features in addition to the ratio+chrono libraries, I was wondering if in addition to procees CPU usage you can add thread CPU usage. What about CPU% for process and a threads?
The need that comes up over and over is for wall-clock time, and per process cpu user and system time. And that's what POSIX times() and equivalent Win32 functions have provided for many years.
On some operating systems there are lots of other times available, but I have no idea if these other times have portable equivalents. Did you have something specific in mind, or was it a theoretical question?
In Linux each thread is seen as a process, so it is posible to obtain the CPU usage of a thread. In fault taulerant systems, a thread that loops (BUG) would take a high CPU%. This can be used to detect this kind of situation and abort the process.
Are these in the scope of your library?
process_timer gives real, user and system times. What about iowait?
It would be useful if generally available. Ideas for how to measure on Windows and POSIX would be appreciated.
I don't know Windows at all. In unix like systems you find these informations on the /proc/'pid'/stat. Regards, Vicente