From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 829 invoked by alias); 4 Feb 2006 15:00:19 -0000 Received: (qmail 820 invoked by uid 22791); 4 Feb 2006 15:00:18 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 04 Feb 2006 14:59:14 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F5OsZ-0004WX-Hi; Sat, 04 Feb 2006 09:59:11 -0500 Date: Sat, 04 Feb 2006 15:00:00 -0000 From: Daniel Jacobowitz To: Ian Lance Taylor Cc: gdb-patches@sourceware.org Subject: Re: RFA: Various Windows (mingw32) additions, mostly relating to select or serial ports Message-ID: <20060204145911.GC17011@nevyn.them.org> Mail-Followup-To: Ian Lance Taylor , gdb-patches@sourceware.org References: <20060203220529.GA3578@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00075.txt.bz2 On Fri, Feb 03, 2006 at 10:28:16PM -0800, Ian Lance Taylor wrote: > Daniel Jacobowitz writes: > > > The one I'm least proud of is pipes - there does not appear to be a way to > > sleep and have the OS wake you when data is available on a pipe. So I poll > > every 10ms in a thread. Yuck! The other three all have subtly different > > wait mechanisms. > > Why do you have to poll? You should be able to have a thread which > just sleeps on reading the pipe. When the thread reads something, it > can signal the main thread, passing it the character which it read. I am glad you asked. Oh, so glad. I can't read from the pipe, because I can't pass the data to the main thread. There's a dissimilarity between the console and pipe support, and the serial and socket support. I used the serial.c interface for both pairs, but the serial and socket devices are accessed exclusively from the serial interface. On the other hand, that interface is only used for managing TTY state (and now for select) for the other two. The pipe I was interested in supporting was on stdin, and that gets read from in all sorts of interesting places - like inside the bowels of readline. If I read a character from the pipe, it's going to get lost. Pity there's no ungetc equivalent under the read() layer. -- Daniel Jacobowitz CodeSourcery