HP3000-L Archives

November 1995, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jerry Fochtman <[log in to unmask]>
Reply To:
Date:
Thu, 9 Nov 1995 10:01:00 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
Gavin wrote:
 
: Dan asks:
: > Is there any way for the parent process to be notified upon child process
: > termination?
:
: One idea...
:
: If each son process already has a message file open for write access which
: the father process is waiting on, simply have the father process enable
: reading writer IDs on the message file(s) with FCONTROL 46.  This will
: cause the system to write a CLOSE record to the file when the son dies,
: which will cause the father to wake up since he is waiting for data on
: that file. (It will also cause each record read to be prefixed with a 4
: byte record type and writer ID.  The father will need to filter out
: OPEN records and strip the extra data off the front of DATA records).
 
Expanding on Gavin's idea....under the assumption that the restriction
that a son cannot write to the father's input files also means the son
also cannot open the father's input file:
 
One could establish a single message file for son communication to the
father.  Have the father and each son immediately open this file.  Have
the father enable reading of writer-IDs.  Then have the father enable a
software interrupt for the file (FCONTROL-48) before the father goes into
the IOWAIT call on his other input files.  While in the IOWAIT call, if a
son terminates causing a CLOSE record in the message file, the father's
interrupt procedure will be invoked even while in the IOWAIT.  In turn,
the interrupt procedure would retrieve the record from the file to obtain
the writer's ID, perform whatever and upon exit (FINITSTATE, FINITEXIT
intrinsics), the father would be returned back into the IOWAIT call where
it was prior to the interrupt.
 
I've played around with these software interrupts but never used it in
this fashion.  Seems like this might work but would suggest you do some
further investigation based upon your particular needs....  :-)
 
-- Jerry

ATOM RSS1 RSS2