Re: Question about threads



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...

Thanks
Mike

On Sun, 18 Feb 2001, Havoc Pennington wrote:
Mike Dreibelbis <maddoc en com> writes: 
However when I comment out the three statements which are direcly
related to threads:

g_thread_init(NULL); 
gdk_threads_enter();
gdk_threads_leave();

the program compiles and runs fine on the sparcserver. So I guess
I'm wondering if these statements are needed at all. Will something
evil happen that I'm not running into without them?  

The hang is a deadlock, no doubt. By removing these lines you remove
all locking, so don't get a deadlock, but you do get a total lack of
locking. Which will normally lead to something evil, yes. ;-)

If the above doesn't make any sense to you, you may want to read up on
threads a bit more.

Havoc




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