bi-directional named pipe

View: New views
2 Messages — Rating Filter:   Alert me  

bi-directional named pipe

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The upcoming upstream Autoconf 2.64 release will introduce a new feature for
parallel testsuite execution, which can vastly decrease the time spent testing
several packages (autoconf itself, m4, tar, findutils, ...).  However, it
currently requires support for bi-directional named pipes.  POSIX does not
require this, but Linux provides it; is there any chance of implementing it in
cygwin?

On Linux:
% mkfifo fifo
% exec 5<>fifo
% echo hi >&5
% read a <&5
% exec 5<&-
% echo $a
hi
% rm fifo
%

On Cygwin:
$ mkfifo fifo
$ exec 5<>fifo
$ echo hi >&5
bash: echo: write error: Communication error on send
$ echo $?
1
$ read a <&5
$ echo $?
1
$ exec 5<&-
$ echo $a

$ rm fifo
$

In isolation, I can work around this with two fd's, but the autoconf usage is
more involved, so I'm not sure if using two fd's instead of a single read-write
fd will introduce other problems.

$ exec 5<fifo 6>fifo
$ echo hi >&6 &
$ read a <&5
$ wait $!
$ exec 5<&- 6>&-
$ echo $a
hi
$ rm fifo
$

--
Eric Blake



--
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


Re: bi-directional named pipe

by Christopher Faylor-8 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Jul 02, 2009 at 02:55:16PM +0000, Eric Blake wrote:
>The upcoming upstream Autoconf 2.64 release will introduce a new feature for
>parallel testsuite execution, which can vastly decrease the time spent testing
>several packages (autoconf itself, m4, tar, findutils, ...).  However, it
>currently requires support for bi-directional named pipes.  POSIX does not
>require this, but Linux provides it; is there any chance of implementing it in
>cygwin?

I'm not going to perturb this code again before 1.7.1 is released.
Possibly after that but I wouldn't hold my breath.

cgf

--
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