From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22648 invoked by alias); 4 Feb 2006 06:28:25 -0000 Received: (qmail 22640 invoked by uid 22791); 4 Feb 2006 06:28:25 -0000 X-Spam-Check-By: sourceware.org Received: from yosemite.airs.com (HELO yosemite.airs.com) (205.217.158.180) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 04 Feb 2006 06:28:24 +0000 Received: (qmail 25710 invoked by uid 10); 4 Feb 2006 06:28:23 -0000 Received: (qmail 3228 invoked by uid 500); 4 Feb 2006 06:28:16 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sourceware.org Subject: Re: RFA: Various Windows (mingw32) additions, mostly relating to select or serial ports References: <20060203220529.GA3578@nevyn.them.org> From: Ian Lance Taylor Date: Sat, 04 Feb 2006 06:28:00 -0000 In-Reply-To: <20060203220529.GA3578@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00057.txt.bz2 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. The cleanest portable event loop which I know of is Tcl. The Tcl code has solved pretty much all the event loop issues for Unix, Windows, and MacOS 9. Ian