<br><div class="gmail_quote">On Thu, Mar 29, 2012 at 9:53 PM, Eli Bendersky <span dir="ltr"><<a href="mailto:eliben@gmail.com">eliben@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_quote"><div class="im">On Thu, Mar 29, 2012 at 21:48, Andrew Svetlov <span dir="ltr"><<a href="mailto:andrew.svetlov@gmail.com" target="_blank">andrew.svetlov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I propose to add Thread.interrupt() function.<br></blockquote></div><div><snip><br></div></div><br>Could you specify some use cases where you believe this would be better than explicitly asking the thread to stop?<span class="HOEnZb"><font color="#888888"><br>
<br>
Eli<br></font></span></div></blockquote><div><br></div><div>The only case I can come up with is wanting to attempt to force a "clean" shutdown of threads spawned by library code out of the main processes control that has not been instrumented with its own well placed checks to see if it is time to shut down.</div>
<div><br></div><div>Given such a mechanism can't interrupt blocking system calls or extension module or other VM native language level code, I'm not super excited about implementing this given the limitations.</div>
<div><br></div><div>It would be relatively easy to add, I just don't see a huge benefit.</div><div><br></div><div>As for using SystemExit as the exception or exception base class, I believe existing code such so some well known event loops catches, logs and ignores SystemExit today... ;)</div>
<div><br></div><div>-gps</div></div>