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

Re: What to do about #252170



Hello!

Sorry for the delay, but I was ill and work keeps me busy.

On Mon, Jun 21, 2004 at 08:57:30PM +0200, Marcin Owsiany wrote:
> I'm sending this message to maintainers of packages which are possibly
> involved in the problem.
> 
> Please read http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252170
> 
> I know very little of X programming, so I have no idea which package is
> "guilty" of the problem:
>  - xmms-xf86audio for using XStringToKeysym
>  - xmms for not caring about setting up Xlib thread support early enough
>  - xosd for setting up Xlib thread support too late
>  - xlib for having such and not other thread support interface
> 
> Anyway, we need to decide how to resolve the problem. Please help.

I investigates this yesterday and here are my findings:
1. xosd is multithreded using 3 threads for X11-exposure, timeout and
control.
2. xosd opens its own X11 display but needs X11-Tread support, so it
calls XInitThread, which is wrong, because xmms dynamically loads the
library way after its first call to X11.
3. Putting an XInitThread()-call in xmms might solve this problem. But
since there are other applications using libxosd, they all must also
call XInitThread() before using libxosd. Not doing this will later crash
the application.

Therefor I see only one solution: Rewrite xosd to use only one thread
for X11 calls. I'll try to do that, but I'm busy with university and my
scouting activities, so it might take me some time. Before I start
coding, I'll ask some questions for the new implementation:

The current implementation has one thread listening for X11 exposures to
redraw the display. The loop blocks using XWindowEvent(). I'm going to
use select() on ConnectionNumber(x11->display).
Another thread handles timeouts. Currently it directly calls X11 to hide
the display. How do I best convert it to something that works with
select() for inter-thread-communication()? Use a pipe()? On Linux I
could get rid of that thread and use select()'s timeval to do the
timeout, since Linux updates timeval to contain the remaining sleep
time. But that's not portable, so for non-Linux I'll have to use
gettimeofday(). Any better ideas?
A third thread will control xosd (updating text, changing colors/fonts)
on users request. This threads will have to also communicate with the
first thread to notify it of changes. Should I use a pipe() or signal()
or what else for inter-thread-communication?

BYtE
Philipp
-- 
Philipp Matthias Hahn <pmhahn@debian.org>
 GPG/PGP: 9A540E39 @ keyrings.debian.org



Reply to: