On Fri, 10 Jan 2003, Christian Reis wrote:

> On Fri, Jan 10, 2003 at 05:19:04PM -0500, Jesse Pavel wrote:
> >
> > I've read that timeout functions registered with gtk.timeout_add()
> > may be called from a separate thread; but is this true even if I
>
> This was a rumor that Jon Nelson brought up, and I have yet to see proof
> of it. I *think* your approach is safe, and that only the GTK thread
> will be used for all GTK operations, no matter what (after all, it *is*
> GTK who is driving the mainloop).

OK, here's the deal.  IIRC, signal handlers properly deal with thread
stuff, but idle functions, i/o-watchers, and timeout functions do *not*.
They are not put into their own thread, at least, not as far as I can
tell, but they don't properly deal with threads from a gtk/gdk level,
either.  Therefore, whenever dealing with one of the latter, make sure
to wrap yer gtk/gdk code in gtk.threads_{enter,leave}

> I don't know anything about threads, though: "I did not say this.. I am
> not here." (Guild Navigator in Dune)
>
> > calls--store events in a Queue, from which they would be picked up
> > by a timeout handler that I hoped would run in the gtk main thread.
> > I wanted to use this design in order to account for setups where
> > GTK threading is unavailable or broken.
>
> Is this GTK 1.2 or 2.x?
>
> Take care,
> --
> Christian Reis, Senior Engineer, Async Open Source, Brazil.
> http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>

--
Democracy is two wolves and a sheep voting on what to have for dinner.
Liberty is two wolves attempting to have a sheep for dinner and
 finding a well-informed, well-armed sheep.

Jon Nelson <[EMAIL PROTECTED]>
C and Python Code Gardener
_______________________________________________
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