[Xcb] GTK-XCB is in progress(Profiling gtk-xcb vs gtk-x11)

Jamey Sharp jamey at minilop.net
Thu Nov 9 17:26:15 PST 2006

On Thu, Nov 09, 2006 at 07:20:53PM -0500, Havoc Pennington wrote:
> Jamey Sharp wrote:
> > This approach isn't thread-safe, which is why XCB's API is designed to
> > discourage it. There may be various reasons why thread-safety doesn't
> > matter at these points in Gdk
> Such as "GDK is in no way threadsafe" ;-)

Yes, exactly that sort of reason. :-) Thanks for the reference.

However, in this case it doesn't matter how threadsafe GDK doesn't
promise to be, for either Xlib or XCB. This code can race with non-GDK
code accessing the same Display outside the GDK lock, since I see
nothing in that documentation that says the Display has to be protected
if you fetch it out with gdk_x11_drawable_get_xdisplay or similar.

So I hope that there are still *other* reasons why it's OK that this
code is not thread-safe: perhaps because these sequence numbers are used
only as an optimization, and it's always OK if they lag behind the true
sequence number?

Meanwhile, I still want to know why you can't just iterate the main
event loop when you want to reduce memory usage. Doing so would make
this port a lot easier, and make the code quite a bit shorter.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061109/3b748442/attachment.pgp

More information about the Xcb mailing list