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



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.

--Jamey

Attachment: signature.asc
Description: Digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]