Queue enhancement suggestion

Hendrik van Rooyen mail at microcorp.co.za
Wed Apr 18 00:50:17 EDT 2007


 "Antoon Pardon" <a...n at f.l.vub.ac.be> wrote:


> The problem is that sometimes the gui thread has something to show
> too. With the added problem that the code wanting to show something
> doesn't know when it is executing the gui thread or an other. So
> it is very difficult to avoid the gui thread putting things on the
> queue. But since the gui thread is the single reader, it will dead
> lock if the queue happens to be full at the moment the gui thread
> want to add another item.

This can happen - I suppose the cure is to have the GUI use a non blocking
put in a try except checking for the full condition - its bad to block the GUI
anyway because then the mouse and kbd become unresponsive.  So even
the reads (get) have to be non blocking, or the thing will behave like a 
disobedient dog, that knows what to do, but just refuses.

- Hendrik





More information about the Python-list mailing list