[PATCH 2/4] X event queue mutex

Tiago Vignatti vignatti at c3sl.ufpr.br
Thu Oct 2 14:58:01 PDT 2008


Keith Packard escreveu:
> The input queue is written so that each user modifies only one of the
> two pointers (head and tail). There shouldn't be any need to have a
> mutex which protects both of these values together, and doing so
> prevents mouse motion while the server is processing events.

Yeah, but the input thread can change the tail pointer while the main
thread is reading that, doing dirty things.

At least this is the theory and I'm not 100% sure if this really impacts 
a real problem on the practical (for instance, today I removed the mutex 
and executed the server all the day long in a SMP machine without any 
apparent issue).

And doing mutex will _not_ prevent the cursor update on the screen while 
the server is processing the events. The update is done before the 
routines of event enqueue, so no mutex there.


> Is there something fundamentally different between threaded input and
> SIGIO- or kernel-based input that I'm missing here?

Besides performance, no. Basically this a replacement feature and 
eventually locking the cursor's footprint in memory (my next adventure) 
will solve all the problems of the universe.


Thanks for reviewing it, Keith.

-- 
Tiago Vignatti
C3SL - Centro de Computação Científica e Software Livre
www.c3sl.ufpr.br




More information about the xorg mailing list