Well, hopefully you don't have to learn too much. I and other people have some sample code in this thread:
http://www.daa.com.au/pipermail/pygtk/2004-February/006960.html


I didn't think about the case where the main thread is also adding lots of things to the queue. One option is to have a RLock() try to acquire, and if successful, to also clear the queue. That way the main thread will always have a clean queue and things won't pile up.

-dave


Thomas Mills Hinkle wrote:

Okay, so I think between this and the other thread, I'm gathering that
gtk.threads_enter() and gtk.threads_leave() will not keep me safe, and
that the recent bug I found is the first of many I may have to encounter
over the life of my app,esp. if I port it to Windows.

So I'm going to add learning-about-queue's to my to-do list and hope
that that makes my threading woes go away. I probably won't get to this
until the weekend. The bit of sample code Tim Evans posted in response
to Jamie Norrish's problem will help me get started. Are there other
queue examples that I've just missed i.e. in the FAQ?  If not, perhaps
it would be worth piecing one together and referencing it in the section
of the FAQ that describes gtk.threads_enter() and other alternatives
(generators, weightless threads).

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



_______________________________________________ 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