signal inside signal

signal inside signal

Post by David Tralle » Fri, 30 Aug 2002 09:58:53



I am almost sure that the answer is yes, but I dont know where to read
to check it out.

If a "signal treatment function" is interrumped by the same kind of
signal (so the same function is called), when the "second signal
function" is finished, the execution continues in the first function
... true?

thanks in advance,
DTM

 
 
 

signal inside signal

Post by Kasper Dupon » Fri, 30 Aug 2002 15:16:14



> I am almost sure that the answer is yes, but I dont know where to read
> to check it out.

I don't know where to read about it. But to me it is obvious that you
are right.

Quote:

> If a "signal treatment function" is interrumped by the same kind of
> signal (so the same function is called), when the "second signal
> function" is finished, the execution continues in the first function
> ... true?

Yes, that is the case. It couldn't be different from that anyway.
Though you should notice that by default the signal is blocked while
the signal handler is running. I'm not sure about the other signals,
it would be possible to setup the handlers such that you could have
one invocation of each signal.

If you haven't already done so you might want to read the man page
about sigaction and sigprocmask.

--
Kasper Dupont -- der bruger for meget tid p? usenet.



 
 
 

signal inside signal

Post by Nils O. Sel?sd » Fri, 30 Aug 2002 17:13:30




>> I am almost sure that the answer is yes, but I dont know where to read
>> to check it out.

> I don't know where to read about it. But to me it is obvious that you
> are right.

>> If a "signal treatment function" is interrumped by the same kind of
>> signal (so the same function is called), when the "second signal
>> function" is finished, the execution continues in the first function
>> ... true?

> Yes, that is the case. It couldn't be different from that anyway.
> Though you should notice that by default the signal is blocked while
> the signal handler is running. I'm not sure about the other signals,
> it would be possible to setup the handlers such that you could have
> one invocation of each signal.

> If you haven't already done so you might want to read the man page
> about sigaction and sigprocmask.

Also the GNU libc manual can be of great help.
http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_toc.html
 
 
 

signal inside signal

Post by Paul Pluzhniko » Sat, 31 Aug 2002 00:05:10



> If a "signal treatment function" is interrumped by the same kind of
> signal (so the same function is called),

If by "the same kind of signal" you really mean "the same signal", then
you may want to note that this will never happen, unless you specifically
ask for it to happen (by setting SA_NODEFER or SA_NOMASK in call to
sigaction):

http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_498.html#SEC508

    When a handler function is invoked on a signal, that signal
    is automatically blocked (in addition to any other signals
    that are already in the process's signal mask) during the time
    the handler is running. If you set up a handler for SIGTSTP,
    for instance, then the arrival of that signal forces further
    SIGTSTP signals to wait during the execution of the handler.

Cheers,
--
In order to understand recursion you must first understand recursion.