2007/10/17, Javier Fernandez-Sanguino &lt;<a href="mailto:jfs@computer.org">jfs@computer.org</a>&gt;:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; 1. mainThread on KeyboardException send yourself HUP or KILL signal and this<br>&gt; signal kills all thread.<br>I&#39;m not sure but, can&#39;t the parent send sighups to all threads? (this<br>is what is commonly done in processes spawned by servers, but I don&#39;t
<br>know if this is possible with threads)</blockquote><div>&nbsp; Basic threading module don&#39;t provide this functionality. In discussions i see references to Java threads implementation (base for python threading model), and many people point that stop() method in threading API is deprecated (by thread security reason).
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; 2. Use sockets timeouts. With timeouts accept call was interrupted after<br>
&gt; some time. But in this case i must rewrite some methods of parent HttpServer<br>&gt; class.<br>However, this has the problem that the interrupt is not inmediate, right?</blockquote><div>&nbsp; Right, but timeout very small. Simply i don&#39;t like rewrite methods of parent HttpServer class to correct support this timeouts. I prefer put this in TODO for future, maybe it will more elegant solution.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I think the simplest would be #1. After all, a Ctrl+C is equivalent to<br>a SIGKILL sent from the console, right?
</blockquote><div>&nbsp;&nbsp; No, Ctrl+C is equivalent to SIGINT. I will try to sent SIGHUP signal in Ctrl+C handler and see results.<br></div></div><br>-- <br>Pavel Vinogradov<br>NixDev.Net, Linux Developer