From: Julian S. <js...@ac...> - 2003-04-09 07:45:22
|
On Wednesday 09 April 2003 7:17 am, Sefer Tov wrote: > Indeed, you were both correct. > I am running it on a laptop (compaq armada m300) with apm enabled. > > I must admit that this proves to be quite an annoyance, since I do most of > my work on a laptop. Does that affect the timing of other functions as > well? > > I'm unfailiar with these high resolution time counters in x86, but it > strikes me odd that Intel wouldn't provide an equivilant, reliable > mechanism for laptops as well (maybe in exchange of accuracy or slight > performance impact). > > I'm curious, is there any way around this? Try the patch called 09-rdtsc-calibration from http://www.goop.org/~jeremy/valgrind/ J > > Thanks in advance, > Sefer. > > > From: Julian Seward <js...@ac...> > > >To: Jeremy Fitzhardinge <je...@go...>, Sefer Tov <se...@ho...> > >CC: val...@li... > >Subject: Re: [Valgrind-users] Scheduler problem > >Date: Tue, 8 Apr 2003 21:24:24 +0000 > > > > > >Sefer, > > > >I tested the program you sent me (below) and it behaves > >identically running on V from normal; no timing anomalies. > >This is running on a 1133Mhz PIII-T (desktop) machine. > > > >I suspect Jeremy may be right about the power management thing; > >he's had a patch available for that for a while. Can you > >clarify the situation re power management on your platform? > >Thanks. > > > >J > > > >#include <pthread.h> > >#include <stdio.h> > >#include <unistd.h> > > > > > >void *start(void *p) > >{ > > printf("Hi!\n"); > > sleep(1); > > printf("Here\n"); > > sleep(1); > > > > return 0; > >} > > > > > >int main() > >{ > > pthread_t tid; > > void *p; > > int i; > > > > for ( i = 0; i < 5; ++i ) { > > pthread_create(&tid, 0, start, 0); > > } > > pthread_join(tid, &p); > > > > return 0; > >} > > > >On Tuesday 08 April 2003 10:12 am, Jeremy Fitzhardinge wrote: > > > Quoting Sefer Tov <se...@ho...>: > > > > Hi! > > > > > > > > I've been testing a short threaded program, and I noticed that > > > >sleep(x), > > > > > > although utilizes no cpu, it schdules poorly (the program slows down > > > > almost > > > > to a halt). > > > > > > Is your machine a laptop, or a desktop with power management enabled? > > > Valgrind uses the TSC register as its timebase, and I've noticed on my > > > laptop the TSC doesn't advance when the machine is idle. You can > > > easily tell if this is the case: if you run a CPU-bound program at the > > > same > > > >time, > > > > > then the TSC advances at near full speed and the sleeps are for the > > > >right > > > > > time. > > > > > > J > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail |