guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two way pipe


From: Neil Jerram
Subject: Re: Two way pipe
Date: Thu, 26 Apr 2007 21:49:42 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Doesn't `OPEN_BOTH' do what you want? 

Yes, indeed.  Believe it or not, I was looking at a 1.6 distribution
and didn't think to check 1.8 or CVS.  (Newbie alert! :-))

> However, the manual reads:
>
>    Care should be taken with `OPEN_BOTH', a deadlock will occur if
>    both parent and child are writing, and waiting until the write
>    completes before doing any reading.  Each direction has `PIPE_BUF'
>    bytes of buffering (*note Ports and File Descriptors::), which
>    will be enough for small writes, but not for say putting a big
>    file through a filter.

So far I've been playing with (open-input-pipe "mplayer -slave ..."),
but not bothering to select on and read from the pipe.  If the track
being played is longer than about 3 minutes, mplayer crashes - and I
assume that's because its write to stdout is failing unexpectedly.  So
for some programs, it seems that filling up the pipe buffer can be a
problem even if in only one direction.

When I implement things fully this won't be a problem, because the
Guile app will be reading any available data from the pipe as soon as
it's there, and only very rarely writing anything.

Many thanks,

     Neil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]