Re: Question about threads



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]