[Xcb] xpyb and threading

Ander Martinez dwarfnauko at gmail.com
Sat Feb 20 07:15:07 PST 2010


Hello, this is the first time I write to this list.
I've been writing some stuff using xpyb. I have multiple threads in
python and one of them is using wait_for_event which caused the whole
process (the interpreter and therefore the other threads) to block.
Some investigation brought me to xpyb/src/conn.c where sandwiching the
line 'data = xcb_wait_for_event(self->conn);' between
Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS solved my issue. I've
included a patch.

Also, I think that most blocking functions should unlock the GIL, but
I haven't patched that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conn.patch
Type: text/x-patch
Size: 372 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xcb/attachments/20100220/d96235dd/attachment.bin 


More information about the Xcb mailing list