Re: Gnome/Gtk and thread safety



Maciej Stachowiak <mjs eazel com> writes: 
> Yes, but this problem is not really specific to Gtk+. You can't use
> global variables without a mutex for the variable, period; the
> `gtk_widget_new' call is a red herring. Anyone who wants to use
> threads understands basic concepts like that, I think, and I don't
> believe anyone expects Gtk+ to lock their global variables for them.
> 

But you end up with the same situation in less obvious ways; e.g. you
set a value in some struct which is in some other struct which ends up
being global. So the safest thing from a threadsafety standpoint is to
always own a reference to everything you touch.

Havoc




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