In article <19475d1c-ee83-4466-ba55-b352ea760...@x5g2000yqk.googlegroups.com>, <stephane.bisin...@gmail.com> wrote: >On Apr 18, 4:28=A0pm, a...@pythoncraft.com (Aahz) wrote: >> >> Essentially, you use the Queue instead of the Condition. =A0When you want >> to explicitly give up control in a thread, you get() on the Queue until >> you get an object (with the optional timeout). =A0When the other thread i= >s >> done processing, it puts an object on the Queue (optionally doing a >> get_nowait() at some point if it wants to make sure the Queue is cleaned >> up). > >Yep but as I said I have nothing to pass around
You create it -- it's essentially a plain sentinel in this case. >> The critical advantage of using Queue is that you don't have to do the >> acquire()/release() dance. > >And neither do I have to using the "with" statement ;) Fair enough -- I was stuck on Python 2.3 in my last job and I still haven't caught up. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." --Red Adair -- http://mail.python.org/mailman/listinfo/python-list