delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/04/15/19:53:21

From: ian AT cygnus DOT com (Ian Lance Taylor)
Subject: Re: Nonblocking serial reads
15 Apr 1998 19:53:21 -0700 :
Message-ID: <199804160239.WAA20325.cygnus.cygwin32.developers@subrogation.cygnus.com>
References: <199804160155 DOT SAA02650 AT skaro DOT cygnus DOT com>
To: noer AT cygnus DOT com
Cc: cygwin32-developers AT cygnus DOT com, noer AT cygnus DOT com, keiths AT cygnus DOT com

   From: Geoffrey Noer <noer AT cygnus DOT com>
   Date: Wed, 15 Apr 1998 18:55:41 -0700 (PDT)

   I've been working on the problem of what should be non-blocking
   serial I/O in GDB blocking, preventing GDB from receiving signals
   when it should.  The culprit is the fhandler_serial class which
   currently always blocks in reads/writes.

   It looks like the solution has already been implemented in tty.cc (see
   fhandler_tty_slave::read).  Where should this code actually be?  Could
   we just make it more generic and then move it to fhandler_base?

I'm not sure just what you are suggesting, but we don't want to be
screwing around like that when reading from a disk file.  It would be
reasonable to move that code into some function which was called for
ttys and for serial ports.  But note that you can't use PeekNamedPipe
on a serial port.  So using asynchronous reads might be better from a
serial port.  Polling is always an extremely bad idea.  The tty code
only does it because Windows doesn't support asynchronous reads from
pipes.

Ian

- Raw text -


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