Re: [GD-General] responsive threading
Brought to you by:
vexxed72
From: Andras B. <and...@gm...> - 2005-08-04 19:13:02
|
It turns out that all the spikes were my fault. I'm deeply ashamed.. I have failed to follow the most important rule of all, that says: profile first! I was pretty sure my application was not the one causing the stalls, since when I turned the other thread off, I got no spikes at all.. What happened is that I also called another small 3rd party library from my main thread, but only when the other thread was also running. This library converts coordinates between different projections (this is a mapping software), and it seems like that sometimes it takes a pretty long time to do this operation, that I assumed to be basically free. Now I'm going to dive into this library, to see what's going on. I think I've learned my lesson: PROFILE, PROFILE, PROFILE! DO NOT MAKE ASSUMPTIONS! EVER! Thanks, Andras Andras Balogh wrote: > I'm developing a graphics application, that I want to be very > responsive, very smooth, all the time! The rendering is pretty simple, > the framerate is high and stable, so I just lock to vsync, and > everything moves beautifully smooth! The CPU usage for this thread is > always below 10%. > > However, I also have another thread, that has to do some heavy work. > This thread does tons of IO operations, and also makes the CPU sweat! > > There is no synchronization between the two threads, so they should be > able to run independently. Still, I'm experienceing sudden spikes in the > framerate, when the second thread is really hammering. What could be the > reason for this? Is it possible to do something about it, to regain the > continuous framerate? I'm really not interested in the performance of > the second thread, I just want my first thread to run as smooth as > possible! I've tried lowering the priority for the second thread, and it > does help, but there are still some spikes. Is it possible that it's > Windows itself doing some operations at higher priority, like memory > management, IO stuff, and the likes? > > Thanks, > > > Andras |