Need help with accurate timers for multithreaded programs on Linux/X-86
"Rajat P. Garg" <[email protected]> Wed, 19 Nov 2003 09:46:48 -0800
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Message-ID | <[email protected]> |
Hi Folks, I will appreciate if people can point me to accurate and reliable timers for multithreaded programs on Linux/X-86 (specifically RH9.0). I have quite a bit of multithreading experience (mainly on Solaris) but very little on Linux. On Solaris, the two timers: gethrvtime() and gethrtime() are proving to be very valuable in tuning/testing the code that I am currently multithreading. On Linux, I have tried both gettimeofday based timer and a timer using RDTSC instruction in IA-32 but am not able to get repeatable and reliable timings with these...well bottomline is that we are seeing reasonable scaling (eg. 1.6-1.7X on 2-way) on Solaris (version 8) but basically none on Linux (RH 9.0). I suspect my lack of experience on Linux is probably the reason...hence request for help from you all. I know this is a very general question but any pointers you all can provide on how to accurately measure time in portions of code (on a per-thread basis) and/or if I should try a different version of Linux thread library will be really appreciated. regards, --Rajat