Re: g_timeout_add minimum period

On Tue, Feb 07, 2006 at 08:39:40PM -0200, Claudio Polegato Junior wrote:
> Hi, do you try put the process on high-priority (nice / renice -20) to see the
> results? And what about real time?<br
> />--------------------------------------------------------------------------------<br
> />...I'm looking for a timeout of 50ms. However, when I try this, I<br /> get a
> consistent 200ms timeout. Is this a limitation of the glib timer<br /> function, or
> a limitation of the default task-switching of the Linux<br /> kernel? Or a
> configuration set-up option somewhere? (This is on a Gentoo<br /> Athlon with a
> 2.6.15 kernel.)<br /> <br /> <br /> <br />

Excellent question. Interesting results. If I run the program with a
nice value of -10, I get a 180ms timeout when the interval parameter is
set to 50ms. With a nice of -15 I get 170ms. (Interestingly enough, with
a nice of -19 it drops back to 180ms.) Definitely seems to point to some
sort of interaction with the kernel scheduler. 

I've just started with GTK programming, so I'm not sure what is going on
under the hood with the main loop, the kernel scheduler and
g_timer_add(). I guess my next step is to try using the kernel services
directly and run a secondary thread outside the main loop. 


                               Bob Johnson
                               KE6FIS arrl net

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]