Re: [AD] XIM patch for Allegro 4.1.x

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Wed, 2004-11-24 at 00:56 +0100, Julien Cugnière wrote:
> Well, I'm using a vanilla 2.6.9 kernel. The kernel is preemptible, if that 
> matters. Anyway, attached is a *weird*, minimal test case.
> 

Same kernel I'm using, then.

> It is highly unresponsive: it can sometime take more than a second before key 
> presses/releases appear on screen. However, if at the beginning, "rest(1)" is 
> replaced by "rest(0)", or removed altogether, then the program becomes 
> perfectly responsive. The problem seems to be caused by the select() call 
> inside rest, because if rest() is replaced by rest_callback(), which uses 
> gettimeofday, then the program works fine.
> 
> The question is, why would calling rest in the beginning of the program slow 
> down a loop later on ?!? This is so weird that if nobody can reproduce it, 
> I'll assume this is a problem with my system being somehow broken...

Your program is completely responsive here - so yes, I can't reproduce this.
I'm using XFree86 4.3.0.1.

When you call rest(0), it gets responsive, right? So I think, it is just
some scheduler setting. It sees the application is using 100% CPU, so it
increases the timeslice, making it unresponsive. If it calls rest(0),
the scheduler will break from the timeslice, and schedule it again at
once - so this makes it responsive. Or something like that. I believe
I remember from the kernel config that you can adjust the scheduler
behavior somehow.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/