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

Barton C Massey bart at cs.pdx.edu
Sat Jan 26 14:53:19 PST 2008


In message <Pine.LNX.4.64.0801251056230.4480 at grozny.maths.univ-evry.fr> you wrote:
> raster wants an event driven design for xcb support in ecore. That means 
> that he wants to send an ecore event when a requested reply is available. 
> In the main loop, we get teh ecore event and the associated xcb reply
> 
> So:
> 
> 1) we send a request that wants a reply.
> 2) in the  loop we check for available replies (with xcb_poll_for reply ?)
> 3) if one exists, we send an ecore event where we store the reply
> 4) the client app can catch the event and hence the reply and deal with 
> it.
> 
> Vincent

I don't know of any reason that xcb_poll_for_reply()
wouldn't work.  It's not really the way XCB was meant to be
used.  I wonder if you wouldn't be better off writing your
own XCB replacement using our protocol descriptions to get
this functionality cleanly?  That's a lot of work, though.

The approach I would take is to give up and be
multithreaded.  You can have a thread block until the next
reply arrives, then create and dispatch the event.  Remember
that it's perfectly OK to receive replies in a different
thread than the request was issued in.

	Bart


More information about the Xcb mailing list