Re: support for threads?



31-Oct-98 14:42 you wrote:

> On Sat, 31 Oct 1998, Todd Graham Lewis wrote:
>> On Sat, 31 Oct 1998, Jeff Garzik wrote:
>>
>> > Are all of these libs thread-safe?
>>
>> Theoretically yes, but no one is really sure, since I don't think anyone
>> has done any multi-threaded GNOME programming.  Give it a shot and send
>> in bug reports!
>>

> If you don't build Gtk with thread support, it's totally unsafe.

> If you do, it looks to me (from gtk/testthreads.c) like each thread has to
> call gdk_threads_enter()  before making GUI calls, and gdk_threads_leave()
> afterward. i.e., only one thread can be doing Gtk stuff at a time.

That is Gtk is DESIGNED to be thread unsafe ???

> Also, lots of the functions in Gtk and Gnome are not reentrant. If any
> are it is probably pure coincidence.

Even worse. Why are Gtk and Gnome designed to be not thread safe ??? Threads
could really helpful on SMP systems and SMP become more common with each day!
Why ???? Full thread-safe glibc, rework of stdlibc++ to do it 100% thread-safe,
fine locks in Linux kernel, microkernel in Hurd and such just to stuck in one
thread in GNOME libs.... What a hell ? Bugs in alpha-quality software is HIGHLY
possible (including occasional non-reenterability) and may be fixes for such
bugs could be low-priority but at the same time API SHOULD be thread-safe from
ground up and non-thread safe things in API should be avoided as much as
possible (ideally there are should be no such things at all) and this questions
SHOULD NOT be low-priority. IMO anyway.

> You'll save yourself lots of headaches if you keep the whole GUI in a
> single thread. You said you're doing this anyway, so no problem. :-)

Yes, of course. But is it right that Gtk and Gnome are DESIGNED to be thread
unsafe ? I decline to belive in such nonsense ! Of course thread safety could
be not-tested well, broken in some places, non-working now (it's alpha quality
software after all!) but gosh: even in braindead WindowsNT I'm could just fine
create two threads in MFC-based program with access to GUI functions in both
threads in the same time!





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