ITEM: AW8764L

Communication between parent and child processes.



Question:

Model: 220
Problem: Communication between parent and child processes.
defunct processes. 

Response:

Env:    AIX 4.1

Desc:   Customer has setup a signal handler with sigaction to capture
        SIGCHLD so that the child process is cleaned up when it exits.
        He runs into a situation where the signal handler is called
        and then wait() to process the death of the child but a 
        defunct process is still created.  It seems as if 2 signals
        are occurring at the same time and they are not being queued
        so that 1 is dropped.

        Does AIX queue signals or does he need to mask out the
        signal when he enters the handler so that it does not
        interrupt the processing.  Then when he left the signal
        handler he would receive the 2nd signal.

Next:   Queue to B3LANG for assistance

Response:

Action:
        How signals are handled in AIX.

        When a Contact Switch is performed by the kernel the signal
        table for a process is checked. If a registered signal has been 
        received, the signal handler for that signal is scheduled to 
        run. If two or more of the same signal should happen for 
        the same process, before the flag can be reset, signals 
        may be lost.  Not all signals are guaranteed to be captured.  

        To get around this problem, functions waitpid and wait3 with 
        the NOHANG option will search the list of child processes and 
        return the pid of a child process that was found to be in a
        ZOMBIE state.  So looping until the return code for wait3
        is equal to 0 would take care of all pending(zombie) children.

Next:
        email to customer.



Support Line: Communication between parent and child processes. ITEM: AW8764L
Dated: February 1997 Category: N/A
This HTML file was generated 99/06/24~13:30:24
Comments or suggestions? Contact us