On Mon, 8 Jul 2002, Malcolm Tredinnick wrote:
> On Sun, Jul 07, 2002 at 06:29:37PM -0700, icewind wrote:
...
> > In that while loop I put the code you suggested. When
> > I run the application, I get the following message
> > output (many times):
> > 
> > GLib-WARNING **: g_main_iterate(): main loop already
> > active in another thread
> 
> Urrgh. Don't do that. :-(
> 
> The "traditional" method to accomplish what you are trying to do here is
> to have one thread which is solely respnosible for updating the gui and
> calling gtk_main_iteration(), etc. The other threads will set shared
> variables which will be read by the "gui" thread and used to update the
> visual portions of the output.

 Yucky. Polling is sooooooooo second millenium:
  - It introduces unnecessary complexity (another thread to manage and
control, as well as managing the deltas between polls)
  - It slows runtime (due to some lame-o thread that periodically thwacks
a bunch of variables, only to discover that their value hasn't changed
since the last poll)
  - It is difficult to implement in an extensible and useful way (either 
the polling thread must explicitly know of each variable to probe, or 
there has to be some horrible "listener" concept)


 Would other solutions, such as threads_enter() and threads_leave() solve
your problems more cleanly? 

 see http://www.daa.com.au/pipermail/pygtk/2000-October/000442.html


e

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to