help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems stopping simulations in emacs shells


From: Pascal Bourguignon
Subject: Re: Problems stopping simulations in emacs shells
Date: Tue, 12 Jul 2005 21:44:50 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

david@adboyd.com (J. David Boyd) writes:
> And sometimes I've found that I need to hit Ctrl-C many times to get out of a
> job running in a shell.  Must be something that is timing dependent.

Not exactly.

C-c is usually bound to SIGINT in the shells.  That is, when you type
C-c, the terminal driver sends the INT signal to the process
controling the terminal.

The process can handle any and all signals, but KILL, as it wishes.
For most signals, if nothing is done by the process, the default is to
kill the process.  But a program can set a signal handler for the INT
signal and do whatever it please it.  Honest programs try to flush
their buffers and close their files and exit promptly.  However, if
they hang (infinite loop or waiting for I/O or just take more than a
few seconds to be noticed by the user), while doing, the user will be
unhappy and will type C-c C-c C-c, etc sending a useless sequence of
INT signals.  If the process is not waiting in the kernel doing I/O
('D' state in ps), then it can be forcybly terminated immediately with
the KILL signal:  

    kill -KILL $PID

But really, you should be patient and let the process close its file
if you don't want to lose data, unless you know the process is bugged
and not doing what it should.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

This is a signature virus.  Add me to your signature and help me to live


reply via email to

[Prev in Thread] Current Thread [Next in Thread]