Re: GTK+ thread problem (program freezing using these 2 GTK+ commands...)
- From: Bharat Bhushan <bharat CS Arizona EDU>
- To: <seberino spawar navy mil>
- Cc: <gtk-list gnome org>
- Subject: Re: GTK+ thread problem (program freezing using these 2 GTK+ commands...)
- Date: Thu, 31 Jul 2003 17:34:05 -0700 (MST)
We cannnot use gdk.threads_enter() and gdk.threads_leave() blindly. You
need to understand why / when these functions are used, otherwise the
program will freeze. For example, you cannot use these functions when
gtk main loop is running (like it does when we call gtk_dialog_run(),
for example). There is decent documentation abt it at:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Threads.html
good luck,
Bharat
--------------------------------------------------------------------------------
On Thu, 31 Jul 2003 seberino spawar navy mil wrote:
> We have a Python GTK+ program that uses threads.
> If we DON'T run the GTK+ GUI
> code then multitasking is fine and every thread gets a little CPU time.
>
> If we run a GTK+ GUI in the main parent process/thread then program
> freezes.
>
> The PyGTK commands called gtk.threads.thread_enter() and
> gtk.gdk.threads_leave() are used to avoid conflicts caused by
> two threads writing to GUI at the same time. The disallow/allow
> other threads to write to GUI as needed.
>
> It would seem that the problem are with these two commands but
> we cannot seem to find the problem. As you know, threads
> are not the easiest things to debug.
>
> We are wondering if Python threads are unstable.
> Are they??
>
> Any ideas at all how to begin to solve this?
>
> Chris
>
> --
> _______________________________________
>
> Christian Seberino, Ph.D.
> SPAWAR Systems Center San Diego
> Code 2872
> 49258 Mills Street, Room 158
> San Diego, CA 92152-5385
> U.S.A.
>
> Phone: (619) 553-9973
> Fax : (619) 553-6521
> Email: seberino spawar navy mil
> _______________________________________
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]