[Xcb] XCB I/O mechanism - Native win32 port

Jeetu Golani jeetu.golani at gmail.com
Sat Mar 29 02:22:18 PDT 2008

Hi guys,

As I've mentioned in the list I'm attempting to port the XCB library to Win32.

I'm trying to understand the I/O mechanism used within XCB. As I understand it 
we seem to be using Non-blocking sockets with a synchronous i/o provided by 
the select function within xcb_conn_wait. 

- Win32 has a concept of Overlapped I/O which allows for data to be copied 
directly into the user buffer directly as soon as it arrives into the lower 
layer. It signals a completion routine or an event automatically. 

- We seem to be using a select function within xcb_conn_wait to poll for the 
state of the socket which in mind means we're using non-blocking sockets with 
a synchronous i/o.

- If using select is synchronous then how would we do a asynchronous i/o 
communication within linux. My limited understanding of the difference is 
that in one the application has to poll for socket state using select and in 
another as soon as the state changes the application is made aware using 
another thread and a notification mechanism. Is this correct? 

- Which would be more efficient with for Win32 Overlapped I/O or sticking to a 
mechanism with select?

I admittedly have little understanding of the above and would appreciate if 
someone could shed light on what would be the preferred mechanism for this 

Bye for now

More information about the Xcb mailing list