[Xcb] knowing when the X server will send the reply

Barton C Massey bart at cs.pdx.edu
Tue Jan 29 17:52:33 PST 2008


In message <20080129204651.GA994 at id.minilop.net> you wrote:
> The issue to worry about here is not a "race" in the
> classical sense, but it has about the same result. When
> you send a request, XCB (like Xlib) may read some
> unrelated response off the wire. Then when you get around
> to your select() call, there's nothing on the wire to
> read, so you block--but you could have made progress by
> polling XCB's queues. In the worst case, this leads to
> your application hanging, so it can also resemble a
> deadlock.

If you're single-threaded, and always careful to empty out
the queue right before blocking in select(), I think you
won't see this.

> > I'm just saying you'll have to think about it carefully,
> > because this sort of usage of XCB was not well thought out
> > or tested.
> 
> No kidding. Official position: we don't encourage this, but have fun.
> kthxbye. :-)

Exactly.

    Bart


More information about the Xcb mailing list