Charles Lane <[EMAIL PROTECTED]> wrote
| 
| Charles Bailey <[EMAIL PROTECTED]> wrote:
| > Charles Lane <[EMAIL PROTECTED]> wrote:
| >>     .   When child exits, AST routine reads any data written to its MBX
| >>         and discards, preventing hang of main process.
| 
| > Looks like we're still stuck with a race, though, if several processes
| > inherited a single mbx.  I'm not sure how to fix this, though, short
| > of giving each subprocess a new set of mbxen, and having ASTs in the
| > parent copy from those to the "apparent" (i.e. inherited or specified
| > on the command line) PPFs of the subprocess.
| 
| Hold on, I think you've got it mixed up a bit (or I do)...the case mentioned
| above is
|     open(W,"|child")
| Maybe the child spawns grandchildren, but they aren't going to get
| their grubby little hands on the child's STDIN (STDOUT and STDERR,
| yes).
| 
| When "child" terminates, it means that any "grandchildren" are terminated
| also, so if the parent process does:
|     print W "still there?\n";

Ah, here's where I got lost.  Maybe we should just close W when the child
terminates (or at least the underlying C stream -- I wonder what'd happen
when Perl called fclose() on it again later?).

| it will hang when the MBX fills, since the child isn't there to read the
| MBX.  That's what the code mentioned above does...it does a read-and-discard
| of data written to an exited child.  I don't know how "standard" this
| behavior is, but it seemed like the right thing to do.

Sounds reasonable.

| I'm also adding code that discards *output* from a child/grandchildren
| when there's a Perl_my_pclose that indicates the parent won't be reading
| any more.  The pipe gets fully shut down when the child terminates.

Also makes sense.

| I'd think the default should be "unixoid"...much like the situation
| with vmsish/unixish times, but would like to hear if anyone is really

My uneasiness arises in part because I don't like to depart from normal
vmsish behavior (no message on success, message on failure; we'll convenently
ignore BACKUP :-)) in parts of Perl that interact with the rest of VMS.
It'd be nice for Perl to provide an alternative to callers having to
Set Message/NoSev/NoFac/NoId/NoText when they want a silent exit, but
it seems better that it behave by default like most other VMS commands,
especially when the caller can't change it short of modifying the
Perl code itself  (well, they could probably say
C<perl "-Mvmsish=messages" prog>).

| As for !AS replacements, it's "my_exit" that is affected (not
| lib$signal), so there's nothing put in any !AS fields anyway.

True enough -- OK, this is a non-problem.

Regards,
Charles Bailey  [EMAIL PROTECTED]

Reply via email to