Re: [AD] scroll_screen in X11 window mode

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


Peter Wang <tjaden@xxxxxxxxxx> writes:

> > Maybe display is locked most of the time when scroll screen
> > is called often, or there is no XSync and X-server is fed up with
> > drawing requests?
> 
> I think you're right.  Once I changed _xwin_scroll_screen (so that it
> did not enter the XLOCK ... XUNLOCK region unless scrolling actually
> was required) the problem went away.

Blit in a loop does not show that behaviour, because it just buffers
the redrawing request and does not call XSync.  On the other hand,
scroll_screen calls XSync in locked state, so there is very little
time before next scroll_screen enters locked state.  With SIGALRM
handler scroll_screen worked fine, because ENABLE() was handling
pending interrupt.

I don't know details of current interrupt handling (pthreads etc.).
Does event processing wait in XLockDisplay?  If it does, then does
XUnlockDisplay switch to the process waiting in XLockDisplay?  If it
does not, then maybe adding yield after XUnlockDisplay will help?
Or maybe change thread priorities?

I mean this fix is OK, but there might be similar problems and it
would be better to fix the root of the problem, e.g. handle interrupts
that arrive when display is locked.

> If you think it's an okay approach,
> I'll make the changes in CVS, or you can do it.

I can not do it efficiently (connection to SourceForge is too slow)
and I don't have recent CVS copy now.

-- 
Michael Bukin



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