Pipes

David Bolen db3l at fitlinxx.com
Tue Oct 9 17:24:09 CEST 2001


Dale Strickland-Clark <dale at riverhall.NOSPAMco.uk> writes:

> David Bolen <db3l at fitlinxx.com> wrote:
> 
> >
> >For interprocess I normally go ahead and use the popen# functions.
> >For inter-machine I'm much more likely to use an IP approach with
> >sockets (I've done named pipes in pure Windows applications that
> >weren't written in Python but not in Python to this point).
> >
> 
> Popen pipes are not the sort I was after. I need to communicate
> between processes - maybe on separate machines - asynchronously. Popen
> pipes are the synchronous stdout/stdin type of pipes.

You can certainly communicate asynchronously over popen pipes (that's
one of the most useful differences over something like os.system) at
least as far as I'd consider asynchronous with respect to the ongoing
operation of the application.  Although perhaps you mean non-blocking,
which isn't the case if you fill up the pipe's buffer in a given
direction.

But yes, to use pipes in a more complicated fashion would probably
require that you resort to OS-dependent methods.  On the Windows side,
that would be opening the pipes directly and using overlapped I/O.  On
the Unix side, setting non-blocking and select would probably be fine.
On Windows, a named pipe connection (the server would have to be
NT/2K) would also work fine (locally on NT/2K, even anonymous pipes
are just named pipes given automatic names) for both local and
inter-machine.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list