[comp.os.vms] How to get a child process to tell its parent that it died

jad@insyte.UUCP (01/15/88)

We are porting our product from a HP9000 running unix to a
VAX running VMS.  The product is written in c.

The way the product works is that the frontend (the editor, etc)
forks off a child process (which does the real work) and the
two processes talk to each other thru pipes.  All this works fine.

The question is, how can the parent process tell if the child has
died?  If something went wrong and the child dies, unless the
parent knows this, it will hang waiting for input.  In UNIX we use 
the death of child signal.

There seem to be several options in VMS.  The first is to
ask the system if the child process (I have the process id) is 
still alive using LIB$GETJPI before every read or write.
I would assume that this would be slow, but I'm not sure.

The second approach would be to use AST's somehow.  Being new to
VMS I'm not sure how yet.

Since this is a fairly common thing to do, I hope someone out there has
already done it!  I would appreciate any help.  Please remember 
that I am new to VMS so make your responses fairly detailed.

Thanks

Jill Diewald
Innovative Systems
1 Gateway Center Suite 910
Newton, Ma 02158
Phone: 617-965-8450

email: ... /harvard/axiom/insyte/jad

tihor@acf3.NYU.EDU (Stephen W. Tihor) (01/19/88)

another method is to have the child take out a lock exclusive and then 
queue an incompatible request for the same lock form the parent.

Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: mckenney@acf2.UUCP (Alan Michael McKenney)
Date: 18-Jan-88 10:32 EST
Date-Received: 18-Jan-88 10:32 EST
Subject: Flakey 1040 problems.
Message-ID: <22060001@acf2.UUCP>
Path: acf3!acf2!mckenney
Newsgroups: comp.sys.atari.st
Posting-Version: version nyu B notes v1.5 12/10/84; site acf2.UUCP
Organization: New York University

   I have an Atari 1040ST with a second disk drive (SF314 -- DS/DD),
and in the last few days I have been having some trouble with it.

1) Apparently sticky keys.  One time I pressed the down-arrow key
   (in the TDI Modula-2 editor, if that helps), and it suddenly acted
   as if I had held the key down (repeated output).  Today, running
   UNITERM, it did that with the Return key.  In the first case, the
   system hung, today I hit a ^C, and it stopped.

2) I/O errors.  I had written a large file on a disk ("1"), and a day
   later, when I went to read (copy) it, I got an alert box saying the
   disk was of the wrong format or something like that.  I had no trouble
   reading other files on the disk, or even reading the directory (it was
   a .ARC file), but when I tried to extract files or copy using DCOPY or
   the Desktop, I got the obnoxious alert box.  I reformatted it (twice!
   the first didn't seem to work: both times w/ DCOPY), and since then
   I've had no trouble with THAT disk.  Later, I got the same alert box
   trying to write a file onto a different disk ("2"); I formatted a fresh
   disk ("3"), and lo! and behold, the disk ("2") I previously couldn't
   write on was suddenly OK.  In case you're wondering, I have write
   verify on, and I format my disks 80 tracks, 2 sides, 10 blocks/trk,
   in "twisted" format, using DCOPY, except disks "2" and "3", which
   I formatted using "IBMFORMT" (?), 80 tracks, 2 sides.

Can anyone give me any clues as to what to look for?

Please reply via E-mail.

Alan McKenney        E-mail:  mckenney@acf2.nyu.edu          (INTERNET)
Courant Institute,NYU         mckenney%acf2@nyucimsa.bitnet  (BITNET)

Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: tmy6405@acf3.NYU.EDU (Ted M. Young)
Date: 18-Jan-88 11:53 EST
Date-Received: 18-Jan-88 11:53 EST
Subject: Re: The Stainless Steel Rat
Message-ID: <4250018@acf3.NYU.EDU>
Path: acf3!tmy6405
Newsgroups: rec.arts.sf-lovers
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <4396@garfield.UUCP>


  The entire Stainless Steel Rat (by Harry Harrison) should be available
in paperback, I know this for a fact because I have read them all!!
I think there is one paperback which combined the first few books into one.
They should be readily available in any major bookstore (new), they are
in print, so looking in used stores is not necessary (unless you want to
save a few $$).  They are all good books, quite funny too (of course that's
my opinion, and you can take it for whatever it's worth).

			-- Ted
			(tmy6405@acf3.nyu.edu)

Disclaimer: None needed, I won't have this acc't much longer. 8-)


Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: tmy6405@acf3.NYU.EDU (Ted M. Young)
Date: 18-Jan-88 11:01 EST
Date-Received: 18-Jan-88 11:01 EST
Subject: Re: How LONG is a CD????????????????????????????
Message-ID: <20060001@acf3.NYU.EDU>
Path: acf3!tmy6405
Newsgroups: rec.audio
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University
References: <sVwKIsy00VU1xD007Z@andrew.cmu.edu>


Apparently Rykodisc will be coming out with a CD with 80 minutes on it!!
This seems to be pushing the medium to the limit, but this maximum time
limit will probably be limited to compilations, classical music, or when 
two albums are released on one CD...I wonder how long it will take before
original music (I'm talking other than classical) will use up the entire
space available (much like Sting did on his latest album, where it was one
CD but two LP's) since the only limitation are the LPs, not the cassettes
or the CDs.

I do not see the prices of CDs coming down to $6.50 anytime soon.  It costs
the big record stores (like Tower records) $9-10 a CD..but I do see it coming
down from the insane price of $15 (retail), mainly because people won't buy
CD players when they see prices double that of LPs or cassettes (which are
getting better all the time, with noise reduction, etc.)

			-- Ted
			(tmy6405@acf3.nyu.edu)


Relay-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
From: tmy6405@acf3.NYU.EDU (Ted M. Young)
Date: 18-Jan-88 12:09 EST
Date-Received: 18-Jan-88 12:09 EST
Subject: Beach Boys Conference
Message-ID: <21660001@acf3.NYU.EDU>
Path: acf3!tmy6405
Newsgroups: rec.music.misc
Posting-Version: version nyu B notes v1.5 12/10/84; site acf3.NYU.EDU
Organization: New York University


For all you Beach Boys fans (and other interested parties), there will be
a Live "Conference" on the CompuServe Information Service.  It will be
held at 11pm (EST) on February 3rd, 1988.  You will be able to ask
questions, chat, and generally have fun.  You must have a CompuServe
subscription (obviously?)..  To get to the COnference, type  GO ROCKNET
at any CompuServe prompt.

Note: I am posting this for informational purposes, I have no official
connection with the ROCKNET forum on CIS, nor do I receive any type of
payment because of this announcement, just thought you might be interested.

Oh, one more thing, ROCKNET has these live "conferences" with famous
artists here and there (recently Del Shannon was on)..Check it out.

			-- Ted [76703,4343]
			(tmy6405@acf3.nyu.edu)

rrk@byuvax.bitnet (01/20/88)

There are many solutions.  The easiest is to use lib$spawn (a RTL procedure)
which automatically sets up a termination mailbox and allows an ast or about
anything else you may wish to happen when the spawned process dies.  You
may find this undesireable since you are used to using "C" in a unix
environment.  I am not sure exactly how the "pipes" you speak of work under
"C", but if your forked process dies after the current image, you could
use the system service sys$dclexh to declare a user-mode exit handler which
would be called under most circumstances of image exit and could send an
obituary down the pipe.