Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: jenkinsj@oils.ozy.dec.com (Jon Jenkins)
Subject: Re: SIGCHLD signal problem in OSF1 3.0
Date: 1995/04/12	[thread overview]
Message-ID: <3mhke4$gg4@nntpd.lkg.dec.com> (raw)
In-Reply-To: 3m16e8$reo@ncar.ucar.edu

David Yeung (yeung@ncar.ucar.edu) wrote:
: Hi

: I am writing a problem trying to catch the SIGCHLD signal when any of
: its child processes dies. But I find that some SIGCHLD signals are lost 
: if more than one child processes terminate simultaneously.

This is traditional UNIX problem. For a refernece read
Richard Stevens Book " Advanced Programming in the UNIX Environment"

WRS says that "if a blocked signal (blocked automatically
during signal delivery) then POSIX.1 allows for the
signal to be delivered either once or more than
once. If the signal is delivered more than once
we say that the signals are queued. Most UNIX 
systems do "not" (his emphasis) do not queue
signals. Instead the UNIX kernal just delivers
the signal once. "

As to whether OSF/1 queues
signals of the same type I dont know
the man pages are silent on this issue.
Perhaps some of the OSF/1 signal people
would comment. They might also like to
comment on the differences between
linking with the two versions (sys5 and bsd)
versions of the library.

He [WRS] goes on to say that 

"The manual pages for System V claimed that SIGCLD
signal was queued, but it realy wasn't. Instead the 
signal was regenerated by the kernel as described
in Section 10.7" (sse the discussion below and code frag)

"The sigaction manual page in AT&T [1990e]
claims that the SA_SIGINFO flag (Figure 10.5)
causes signals to be reliably queued. This is
wrong. Apparently this feature exists within
the kernel, but it is not enabled in SVR4."

Accoring to what is said that fact that
it works onother systems may be a "fluke"
of ther OS timing or OS strategy rather
than a feature. However he does also say
that the SYSV semantics of SIGCLD (NOT SIGCHLD)
are such that if it is placed after the call
to wait() then the kernel will check
if any other children have died
and will recursively call the handler.
This avoids the window problem
of the older unreliable signals.
i.e. func1 should look like:

void    func1 ()
{
        pid_t   pid;

        pid = wait (NULL);
        printf ("func1 pid = %d\n", (int)pid);
        sigset(SIGCHLD, func1);
}

But this dont work either no matter 
which library is linked ;-(

--
----------------------------------------------------------------------
Name:        Dr Jon Jenkins
Location:    Digital Equipment Corp, NaC, 
             Burnett Place, Research Park, 
             Bond University, Gold Coast
             QLD, AUSTRALIA 4229
Phone:       61-75-75-0151
Fax:         61-75-75-0100
Internet:    jenkinsj@ozy.dec.com
Close Proximity: "HEY YOU !!!"

The opinions expressed above are entirely personal and do not
reflect the corporate policy of DEC or the opinions of DEC management.
-----------------------------------------------------------------------



      reply	other threads:[~1995-04-12  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-06  4:00 SIGCHLD signal problem in OSF1 3.0 David Yeung
1995-04-12  4:00 ` Jon Jenkins [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox