About bidirectional named pipes (FIFO)

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Apr 12 13:10:00 GMT 2016


On Apr 12 10:51, Michael Haubenwallner wrote:
> Hi,
> 
> I'm encountering problems with some multi-processing bash script
> that boils down to:
> 
> $ bash -c '
>     rm -f /tmp/testpipe.$$
>     trap "rm -f /tmp/testpipe.$$" EXIT
>     mkfifo /tmp/testpipe.$$
>     exec {fw}<>/tmp/testpipe.$$
>     exec {fr}<>/tmp/testpipe.$$
>     for x in {1..10}
>     do
>       (
>          trap "echo job $x pid \$BASHPID status \$? done >& $fw" EXIT
>          exit $x
>       ) &
>     done 
>     for z in {1..10}
>     do
>       read -u $fr
>       echo $REPLY
>     done
>     wait
> '
> 
> Agreed, POSIX does not define behaviour for using '<>' with fifos,
> but it works with AIX, *BSD, HP-UX, Interix, Linux, Solaris, ...

FIFOs in Cygwin have a couple of problems, especially bidirectional
FIFOs since they require a certain order of usage, otherwise they hang.
The implementation is lacking in more than one way and needs a good
old revamp.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20160412/106fb0e5/attachment.sig>


More information about the Cygwin-developers mailing list