<div class="gmail_quote">On Wed, Aug 10, 2011 at 2:49 PM, Heungsub Lee <span dir="ltr">&lt;<a href="mailto:h@subl.ee">h@subl.ee</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><br></div><div><div>To solve this problem, I&#39;d like to set threads as daemon. So that all related threads are terminated when main loop is interrupted. Any idea on this problem will be appreciated.</div></div><div>
<div><font class="Apple-style-span" color="#cccccc"><br></font></div></div></blockquote><div><br></div><div>Hi Heungsub,</div><div><br></div><div>Two options as far I as I can see:</div><div><br></div><div>1. Instead of having a blocking wait(), perhaps have it wait with a timeout?</div>
<div><br></div><div>2. Why don&#39;t you check out txAMQP, if you&#39;re doing amqp stuff - it has native integration into Twisted. <a href="http://pypi.python.org/pypi/txAMQP">http://pypi.python.org/pypi/txAMQP</a></div>
<div><br></div><div>Keep in mind that if you set the thread as a daemon thread, the thread isn&#39;t actually &quot;killed&quot;, there just isn&#39;t a join() called, so it gets claimed by the OS. This may be no different to what you want, but it&#39;s useful to keep it in mind.</div>
<div><br></div><div>Reza</div><div> </div></div>-- <br>Reza Lotun<br>mobile: +44 (0)7521 310 763<br>email:  <a href="mailto:rlotun@gmail.com" target="_blank">rlotun@gmail.com</a><br>work:   <a href="mailto:rlotun@twitter.com" target="_blank">rlotun@twitter.com</a><br>
@rlotun<br><br>