From: Christopher Faylor <me@cgf.cx>
To: gdb-patches@sources.redhat.com, Eli Zaretskii <eliz@gnu.org>
Subject: Re: PATCH: Support Windows in event-loop.c
Date: Fri, 22 Apr 2005 15:04:00 -0000 [thread overview]
Message-ID: <20050422145958.GH16791@trixie.casa.cgf.cx> (raw)
In-Reply-To: <01c5473e$Blat.v2.4$39651f00@zahav.net.il>
On Fri, Apr 22, 2005 at 04:20:40PM +0300, Eli Zaretskii wrote:
>> Date: Fri, 22 Apr 2005 08:08:04 -0400
>> From: Christopher Faylor <me@cgf.cx>
>>
>> Well, again, I have a rather major technical concern about the use of
>> WaitForMultipleObjects in this scenario, so as the Windows maintainer,
>> I'd like to see that addressed. You can't reliably just use
>> WaitForMultiple on, say, a serial port, a socket, or a pipe, so I don't
>> know how this would ever work.
>
>I'm not sure I understand what you are saying, Chris. Are you saying
>that there's no known way of emulating the Posix `select' on Windows
>in a way that would work on serial ports and pipes? (I assume sockets
>are a non-issue, since the Windows implementation of `select' supports
>them.)
I'm saying that you can't just use WaitForMultipleObjects as a
replacement for select. You have to go to more effort than that,
unfortunately.
AFAIK, the only file-like device that can be used in
WaitForMultipleObjects is the windows console.
>Or are you saying that WaitForMultipleObjects is not the way to write
>such an emulation? If so, what system calls are better candidates?
>
>FWIW, the Emacs emulation of `select' does work on pipes, so it seems
>that at least in that case there's code to borrow.
Cygwin's emulation does too, but it doesn't use WaitForMultipleObjects.
AFAIK, the only way to do non-blocking reads on normal pipes is to poll
the pipe with the PeekNamedPipe call. It's ugly and painful.
The Windows API is full of interesting and useful stuff mixed together
with inexplicably annoying and limited stuff.
>If we cannot make a `select' emulation that works for some of these
>devices, we could simply document them as a limitation. That doesn't
>make the Windows build worse than it is now, does it?
Cygwin has a fully functional select (at least for the read side of
things) so it is possible to come close.
FWIW, you can do non-blocking I/O on serial handles by opening them in
"overlapped" mode but I don't know if there's any way to do that via
the UNIX-lite "fopen/open" MSVCRT interface.
cgf
next prev parent reply other threads:[~2005-04-22 15:04 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-21 5:53 Mark Mitchell
2005-04-21 18:46 ` Eli Zaretskii
2005-04-21 18:49 ` Daniel Jacobowitz
2005-04-21 18:56 ` Mark Mitchell
2005-04-21 20:30 ` Eli Zaretskii
2005-04-21 20:56 ` Daniel Jacobowitz
2005-04-21 21:15 ` Mark Mitchell
2005-04-22 8:26 ` Eli Zaretskii
2005-04-22 12:08 ` Christopher Faylor
2005-04-22 13:23 ` Eli Zaretskii
2005-04-22 15:04 ` Christopher Faylor [this message]
2005-04-22 15:14 ` Ian Lance Taylor
2005-04-22 15:28 ` Christopher Faylor
2005-04-22 15:52 ` Mark Mitchell
2005-04-22 8:16 ` Eli Zaretskii
2005-04-24 22:18 ` Daniel Jacobowitz
2005-04-24 22:30 ` Mark Kettenis
2005-04-25 0:04 ` Mark Mitchell
2005-04-24 23:57 ` Mark Mitchell
2005-04-25 4:25 ` Christopher Faylor
2005-04-25 13:16 ` Daniel Jacobowitz
2005-04-25 14:50 ` Christopher Faylor
2005-04-25 14:59 ` Mark Mitchell
2005-04-25 15:04 ` Daniel Jacobowitz
2005-04-25 15:18 ` Mark Mitchell
2005-04-25 15:23 ` Daniel Jacobowitz
2005-04-25 15:26 ` Mark Mitchell
2005-04-25 15:36 ` Daniel Jacobowitz
2005-04-25 16:44 ` Eli Zaretskii
2005-04-25 20:23 ` Mark Mitchell
2005-04-25 21:07 ` Eli Zaretskii
2005-04-25 21:49 ` Mark Mitchell
2005-04-25 22:00 ` Mark Kettenis
2005-04-25 22:09 ` Mark Mitchell
2005-04-25 22:29 ` Mark Kettenis
2005-04-25 22:47 ` Mark Mitchell
2005-04-26 3:55 ` Eli Zaretskii
2005-04-25 23:16 ` Christopher Faylor
2005-04-25 23:20 ` Mark Mitchell
2005-04-25 23:33 ` Christopher Faylor
2005-04-26 0:21 ` Mark Mitchell
2005-04-26 3:58 ` Eli Zaretskii
2005-04-26 3:59 ` Mark Mitchell
2005-04-25 15:50 ` Ian Lance Taylor
2005-04-26 3:49 ` Eli Zaretskii
2005-04-26 13:17 ` Daniel Jacobowitz
2005-04-25 15:52 ` M.M. Kettenis
2005-04-25 16:00 ` Daniel Jacobowitz
2005-04-25 16:08 ` Ian Lance Taylor
2005-04-25 16:24 ` Christopher Faylor
2005-04-25 17:08 ` Mark Mitchell
2005-04-25 21:04 ` Eli Zaretskii
2005-04-25 16:42 ` Eli Zaretskii
2005-04-21 21:01 ` Christopher Faylor
2005-04-21 21:03 ` Christopher Faylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050422145958.GH16791@trixie.casa.cgf.cx \
--to=me@cgf.cx \
--cc=eliz@gnu.org \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox