delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/02/02/10:43:36

From: ian AT cygnus DOT com (Ian Lance Taylor)
Subject: Re: rxvt and latest Ian's changes.
2 Feb 1998 10:43:36 -0800 :
Message-ID: <199802021842.NAA11902.cygnus.cygwin32.developers@subrogation.cygnus.com>
References: <EnrL1L DOT 52q AT bbc DOT com>
Reply-To: gnu-win32-developers AT cygnus DOT com
To: cygwin32-developers AT cygnus DOT com

   From: cgf AT bbc DOT com (Christopher Faylor)
   Date: Mon, 2 Feb 1998 18:36:56 GMT

   Could the process which has the slave open signal EOF in some other
   way, perhaps, like by releasing a mutex?

Not easily.  The problem is that the master will call read, which will
turn into a call to ReadFile.  That will hang reading from a pipe.
When all instances of the write end of the pipe are closed, the read
will return correctly.

Using a mutex is hard because Windows, in its wisdom, does not permit
asynchronous reads from a pipe.  So as far as I know this would
require creating a thread to hang reading from the pipe, and having
the main code wait for either the thread or for the EOF mutex.  It
might be possible to make this work, but what a pain just to do a
read.  We would still have to keep track of the number of slaves ptys
which were open, to know whether we should presume an EOF or not.

Ian

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019