Re: signals lost in the signalmodule?

lance@fox.com
Fri, 9 Sep 94 14:57:27 PDT

> From: scharf@embl-heidelberg.de
> Date: Fri, 9 Sep 1994 22:41:31 +0100
>
> Guido van Rossum writes:
> > > It seems, that signals get lost, if a signal is raised more than
> > > once while
> > > python is not ready to handle them.
> > [...]
> > > why not accumulating the arrived signals??
> >
> > I don't think this will solve any problems, sice the UNIX kernel also
> > loses signals when the process has not yet handled them.
>
> AHA! So, we will loose all signals between the handler is called and python
> can handle it! Because we call the signal handler signal only once, even if
> the signal occured multiple times befroe the Python signal handler is
> called.
>
> But you wrote about the SIGCHLD problem:
>
> > Changing to System V semantics (requiring the Python handler to
> > re-instate the handler) for all signals has the problem that there is
> > a window within which signals may be lost (between the moment the C
> > handler returns and the Python handler re-instates the handler).
>
> Then I don't understand why it is a problem to delay the reinstallation
> of the
> the signal handler until the signal is handled by python. Now, the C signal
> handler reinstalls the signal immediately, which causes a problem for
> SIGCHLD
> on SYSTEM V. But the reinstallation could be delayed until python
> handles the
> signal, because the signal is regognized only once anyway.
> So it makes no sense
> to reinstall the handler before python has handled it. Then the problem with
> the SIGCHLD wouldd'nt be a problem anymore.

The problem is this. When a signal is caught, the signal function is reset to
SIG_DFL. If there is another signal while the func is SIG_DFL, most
applications will EXIT. This is NOT a good thing at all.

>
> Michael
> --
> __________________________________________________________
> **** ___ _ _ ___ _
> ****** | __) | \/ | | ) | | Michael Scharf
> ******** | _) | | | -< | |_ Tel: +49 6221 387 305 Fax: 517
> * **** |___) |_||_| |___) |___) EMail: scharf@EMBL-Heidelberg.de
> **** __________________________________________________________
>

--
Lance Ellinghouse                lance@fox.com