Cygwin hangs up if several keys are typed during outputting a lot of texts.
Corinna Vinschen
corinna-cygwin@cygwin.com
Wed Mar 4 12:43:00 GMT 2015
On Mar 4 20:34, Takashi Yano wrote:
> On Mon, 2 Mar 2015 15:44:26 +0100
> Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
>
> > > 1) Buffer of named pipe gets full-filled by a lot of data written
> > > by slave side.
> > > 2) WriteFile() in fhandler_pty_master::doecho(), which is called
> > > from master side by key input, is blocked because the buffer
> > > is full.
> > > 3) If a handling to read from the pipe is in the same thread as
> > > key input, the thread falls into deadlock.
> > >
> > > To check buffer space before WriteFile() is one idea,
> > > but it is not smart, I suppose...
> >
> > I think that's not it. For testing I added code to convert the
> > WriteFile calls in fhandler_pty_slave::write, fhandler_pty_master::doecho
> > and fhandler_pty_slave::write to overlapped I/O and made sure to wait
> > for the result after the output mutex has been released.
> >
> > This change has no effect at all. Looks like this needs some more
> > digging.
>
> Hmm.
>
> To confirm my assumption, I have modified the TTY code
> for testing. The modification is shown in an attached
> diff-file against current CVS version. (Note that this
> patch is not for fixing the problem. It is for just a
> testing.)
>
> With this modification, half of buffer is kept empty
> for fhandler_pty_master::doecho(). I assumed the blocking
> could be avoided because buffer is always free.
>
> As a result of the test, it has become clear that this
> modification conceals the problem. This means the problem
> is closely related to occupancy of buffer.
>
> Now, I suppose the cause has been clarified. So we have
> to work out a solution. How can we resolve this problem?
I'm not sure. I still have to look deeper into that. Locally
I treid to woraround this problem by calling WriteFile overlapped
without waiting for the result, but even that doesn't work.
Hmm,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150304/8774a82b/attachment.sig>
More information about the Cygwin
mailing list