Mail Archives: cygwin/2009/07/06/09:03:25
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
My earlier request for bi-directional named pipes is not portable (POSIX
does not require it), so I don't care if we delay it until later. But
here is a case that (usually) works in 1.5 but now (always) fails in 1.7,
and which obeys POSIX as far as I can tell (at any rate, it always works
on Linux, Solaris, and OpenBSD). It would be really nice to have the
regression fixed before 1.7 goes golden, so that autoconf 2.64 can do
parallel testsuites on cygwin. Expected:
$ mkfifo fifo # create a channel for process flow control
$ # spawn a background task which blocks until someone opens the
$ # fifo for reads, then sleeps 25 seconds before writing
$ (exec 5>fifo; sleep 25; echo one >&5)&
[1] 5216
$ # likewise, but sleep less
$ (exec 5>fifo; sleep 15; echo one >&5)&
[2] 5235
$ # open fifo for reading, to kick off parallel background processes
$ exec 5<fifo
$ # wait for clients to complete
$ read a <&5
[2]+ Done ( exec 5> fifo; sleep 15; echo two 1>&5 )
$ read b <&5
[1]+ Done ( exec 5> fifo; sleep 25; echo one 1>&5 )
$ # clean up
$ exec 5<&-
$ rm fifo
$ # see how clients were reaped
$ echo $a $b
two one
But on cygwin 1.7, when you attempt to create multiple writers to a single
fifo, the second writer creates an fd just fine but then fails on any
attempt to write to that fd:
$ mkfifo fifo
$ (exec 5>fifo; sleep 25; echo one >&5)&
[1] 4200
$ (exec 5>fifo; sleep 15; echo two >&5)&
[2] 204
$ exec 5<fifo
$ read a <&5
bash: line 6: echo: write error: Communication error on send
[2]+ Exit 1 ( exec 5> fifo; sleep 15; echo two 1>&5 )
$ read b <&5
[1]+ Done ( exec 5> fifo; sleep 25; echo one 1>&5 )
$ exec 5<&-
$ rm fifo
$ echo -$a-$b-
- --one-
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpR9g8ACgkQ84KuGfSFAYA7dACeMQ/n1J6k8BFICyjLyTjGU5Er
/+sAoJGidQ31qFMDfY7/QFM/h6guUWQh
=Veq6
-----END PGP SIGNATURE-----
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -