A patch for the piping code should be ready to go out later today.
Since my last update, I wrote an extensive "torture test" to find
problems in piping (available on request).

A simplified example of one of the tests:

    open(CHILD,"|perl child.pl")   # child waits 10 sec, reads 1 line, exits
    for ($j = 0; $j < 50; $j++) {
        print CHILD "this should fill the MBX *really* full!!\n";
    }

This will put the invoking script into a nasty RWMBX; in fact, you
don't even get the popen_completion_ast delivered when the child
terminates because of the RWMBX state.  To fix this, writing to a 
child is now done to an "internal" MBX, and an AST routine pulls off
the data to an internal queue, then sends it to an "external" MBX that
the child is reading. 

Other changes:
    There were some race conditions when you write some stuff to a
    child and close the file before the child even starts up, now
    fixed
    
    Multiple reads from a terminated child gives multiple EOFs

    A child reading from a closed file gets EOFs on each read

    All the "Safefree" calls inside AST routines were removed and put
    in the main code.  They were working fine, but may cause problems
    if "perl's memory allocator" is used.  We still have to allocate
    and free memory inside the AST routines that queue input to a
    child, but that's done with LIB$(GET|FREE)_VM, which is (AFAIK)
    AST safe.

I don't think we need the really large MBX sizes now...before, they
helped us "stochastically" avoid RWMBX states.  Now the only reason
for large buffers is if you're reading or writing in large chunks, a
much rarer occurance.  The default mbx size hasn't been changed, but
probably should be reduced to something like ~256 bytes.

BTW, I found out that you really *do* have to have at least some of the
piping fixes in order to get CPAN.pm to work....otherwise you get
stuck with RWMBX'ed subprocesses at various points.
--
 Drexel University       \V                     --Chuck Lane
----------------->--------*------------<[EMAIL PROTECTED]
     (215) 895-1545      / \  Particle Physics  [EMAIL PROTECTED]
FAX: (215) 895-5934        /~~~~~~~~~~~         [EMAIL PROTECTED]

Reply via email to