<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">On Wed, Apr 25, 2018, 06:34 Mark E. Haase <<a href="mailto:mehaase@gmail.com">mehaase@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>This is also an interesting approach that I will experiment with. I guess this solves problem #1 (works on Windows) but not #2 (task stuck in loop), right? (The latter is a feature of all cooperative multitasking systems, yeah?)</div></div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">If a task is hogging the loop, then you won't be able to shut down politely using Task.cancel or similar. But if you're using signal.signal directly then it would mean that your signal handler would still *run* while the loop was blocked, so you'd at least have the option of escalating to os._exit or similar.</div><div dir="auto"><br></div><div dir="auto">I'm not sure I *really* advocate spawning a thread from your signal handler just to call one loop method, but, hey, at least you know your options :-).</div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Great blog post today! I really enjoy your writing style and Trio is really exciting.</div></div></div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">Thanks!</div><div dir="auto"><br></div><div dir="auto">-n</div></div>