Xorg input thread (2)
hcb at chaoticmind.net
Wed Jul 18 01:05:52 PDT 2007
Am Mittwoch, 18. Juli 2007 07:22 schrieb Keith Packard:
> On Tue, 2007-07-17 at 22:15 -0300, Tiago Vignatti wrote:
> > Well, my attempt to do this
> > statically failed.
> Hmm. Last time I did this, it didn't seem *that* hard; tracing the code
> from the mouse device input function through the event queuing code and
> off to the cursor update functions. The thing is, getting it 'wrong'
> only means paging occasionally, which isn't fatal, and can easily be
> fixed after the fact.
> In particular, the code shouldn't be calling *any* libc functions, or
> things like xalloc/xfree as those are not re-entrant from even a signal
> handler. If you're tracing a path like that, we've already lost as you
> can't use the non-threaded C library if that's happening.
You may not even issue any system calls because this might trash the "errno"
variable of the main thread (signal handlers save and restore it
automatically I think), this does of course include poll/read or whatever you
use to receive the mouse data from the kernel.
Using pthreads is probably the only easy option, and as far as I could
determine the overhead of using a threaded libc is lost in the noise (on
Linux you can just LD_PRELOAD libpthread if you want to try without
More information about the xorg