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

Vincent Torri vtorri at univ-evry.fr
Mon Jan 28 14:31:26 PST 2008

On Mon, 28 Jan 2008, Barton C Massey wrote:

> In message <Pine.LNX.4.64.0801282304020.21427 at grozny.maths.univ-evry.fr> you wrote:
>>> If you're very careful, you can do that with
>>> select(2) or poll(2) on the file descriptor of the socket connected to
>>> the X server, but there are subtle traps there too.
>> raster already does that stuff for X events and xcb_poll_for_event (well,
>> i wrote that xcb part, actually). We indeed do a select on the fd. If you
>> want to look ath the code :
>> http://web.enlightenment.org/viewvc/e17/libs/ecore/src/lib/ecore_x/ecore_x.c?annotate=1.130
>> (lines 389, 646 and 671)
>> and
>> http://web.enlightenment.org/viewvc/e17/libs/ecore/src/lib/ecore/ecore_main.c?annotate=1.33
>> (lines 107 and 284)
>> thanks for the reply
> As Jamey said, be careful.  XCB is already being pretty
> clever about using select on the connection fd for its own
> purposes; watch out for races!

can those race conditions be of the same kind that can occur with events ? 
(I'm not an expert at all of threads)


More information about the Xcb mailing list