I have a minor portability issue in Crafty. Goes like this: To
measure system performance (on a SMP platform, of course) I use the
cpu time divided by the elapsed time, so that I can detect cases where
something 'extra' is running and stealing time from "crafty". I have
been using the "times()" system call, but it doesn't quite behave as it
seems it should. IE it is _supposed_ to return process cpu time, + the
cpu time for all child processes. Under linux this doesn't happen. I
kludged it by having each thread measure their own cpu time (my threads
never exit, they spin when idle) and store it in a globally accessible
place, which works ok on linux. But when I run this on other more
'normal' systems (Digital Tru64 unix for example) I get double the
values I get under linux, so that a dual processor machine reports
4x the cpu time used as elapsed time.
I am trying to figure out a way to do this that is portable, but I wonder
if "times()" is simply broken. I just tried it and even though I add all
4 values together, I am _not_ getting the accumulated time for my child
threads as expected, while under Tru64 I do.
Any suggestions? I really just want to know "right now, how much cpu
time has my primary (parent) thread + the child threads used, in total?
And obviously, making it work across multiple unix platforms is necessary.
Robert Hyatt Computer and Information Sciences
[EMAIL PROTECTED] University of Alabama at Birmingham
(205) 934-2213 115A Campbell Hall, UAB Station
(205) 934-5473 FAX Birmingham, AL 35294-1170
-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]