This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: Various Windows (mingw32) additions, mostly relating to select or serial ports
- From: Ian Lance Taylor <ian at airs dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gdb-patches at sourceware dot org
- Date: 03 Feb 2006 22:28:16 -0800
- Subject: Re: RFA: Various Windows (mingw32) additions, mostly relating to select or serial ports
- References: <20060203220529.GA3578@nevyn.them.org>
Daniel Jacobowitz <drow@false.org> 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