Re: gtk + threads



Hi!
Im assuming you are talking about X Errors.
Which cropup on the terminal, and say
X out of sync, etc.

A little bit of reading the gtk-app-devel list
will show you how, 
 X window system calls must be made from only
one thread. Making X calls from two threads
will cause a crash.

I think you must set the gtk_* calls from the
idle_function alone. Thatis , it must be a
part of the main loop that works the GUI.

Communicate with this thread using some type
of IPC/Mutex shared variables etc.

Hope it helps
Muthu

--- Felix Kater <f kater2 gmx net> wrote:

Hi,

in my last program I use threads more extensivly
than before. From time
to time it crashes with gtk errors. Now I wonder if
my strategy of
avoiding gtk errors in a multi threaded environment
is suitable:

Up to now I tried to narrow all changes to gtk
widgets (renaming labels,
draw into drawables etc.) to one single function,
which is running in
idle time. It checks "change-booleans" for each
widget and reacts on
that (renames labels etc.).

Is this the right way to do?
And what is actually - in general - causing the
errors? 

Thanks,
 Felix
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250



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