Re: Question about threads



Mike Dreibelbis <maddoc en com> writes:
Thanks Havoc for your response, however I may not have been
totally clear in my original post. 

At the current time I'm not using any mutex's and the threads are
detached when they are created. Based upon this I don't understand how
they could be affecting a call to gtk_widget_destroy(), which seems to
be the case because it hangs upon exit on *every* one. (But only on
the sparcstation, it works fine under Linux on x86) The dialog boxes are
all part of the main thread and in fact the threads which are spawned
are actually of the "work crew" variety and have no interaction with the
GUI or shared data at all. (At this time anyways).  In fact I can
execute the program so that no threads are spawned and I get the same
behaviour. So yes, it doesn't make sense to me that it should be any
deadlock in this case. I must be missing something here...


Right. Yeah, if you only use GTK from one thread, then g_thread_init()
and the gdk_threads_enter/leave stuff should not be required. You
should be able to simply use a totally unlocked GTK. So I guess that
solves your immediate problem, though it would be nice to get to the
bottom of this deadlock.

In a call such as gtk_widget_destroy(), with locks turned on GTK will
be grabbing and releasing locks quite a few times, so presumably a bug
in either GLib, GTK, or the Sparc thread implementation causes it to
hang. It's hard to speculate on where the problem might be...

Havoc




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