2007/10/17, Javier Fernandez-Sanguino <<a href="mailto:jfs@computer.org">jfs@computer.org</a>>:<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;">
> 1. mainThread on KeyboardException send yourself HUP or KILL signal and this<br>> signal kills all thread.<br>I'm not sure but, can't the parent send sighups to all threads? (this<br>is what is commonly done in processes spawned by servers, but I don't
<br>know if this is possible with threads)</blockquote><div> Basic threading module don'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;">> 2. Use sockets timeouts. With timeouts accept call was interrupted after<br>
> some time. But in this case i must rewrite some methods of parent HttpServer<br>> class.<br>However, this has the problem that the interrupt is not inmediate, right?</blockquote><div> Right, but timeout very small. Simply i don'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> 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