On Mon, Mar 8, 2010 at 11:27 AM, Tobias C. Rittweiler <span dir="ltr"><<a href="mailto:tcr@freebits.de">tcr@freebits.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
In what dynamic context is TERMINAL-INTERRUPT executed? From what I'm<br>
seeing (or rather not seeing :-)), it seems to be executed in an empty<br>
context?<br clear="all"></blockquote></div><br>A SIGINT in a multithreaded program can not be directed at a given thread. The thread that receives it is randomly chosen by the operating system. Instead of letting this happen, the signal servicing thread is polling all asynchronous interrupts, such as SIGINT (and maybe in a near future others, SIGSTOP, SIGTTY, etc) and creating threads that dispatch those interrupts.<br>
<br>But those newly created threads have their own context. They have access to the list of threads, to what is being executed, and to the global and sometimes local bindings of those threads, using the tools from the debugger. However the logic of what to do next is not universal: it depends totally on the user!<br>
<br>One possible choice is to kill or interrupt the only thread which is not the signal servicing one. There are other possibilities, though.<br><br>Juanjo<br><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br>
<a href="http://juanjose.garciaripoll.googlepages.com">http://juanjose.garciaripoll.googlepages.com</a><br>