| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com> |
| List-Archive: | <http://sourceware.cygnus.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT sourceware DOT cygnus DOT com> |
| List-Help: | <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs> |
| Sender: | cygwin-owner AT sourceware DOT cygnus DOT com |
| Delivered-To: | mailing list cygwin AT sourceware DOT cygnus DOT com |
| From: | Chris Faylor <cgf AT cygnus DOT com> |
| Date: | Sat, 25 Sep 1999 13:33:49 -0400 |
| To: | "Patrick J. LoPresti" <patl AT cag DOT lcs DOT mit DOT edu> |
| Cc: | cygwin AT sourceware DOT cygnus DOT com |
| Subject: | Re: Observations on select.cc (19990922 snapshot) |
| Message-ID: | <19990925133349.A18980@cygnus.com> |
| Mail-Followup-To: | "Patrick J. LoPresti" <patl AT cag DOT lcs DOT mit DOT edu>, |
| cygwin AT sourceware DOT cygnus DOT com | |
| References: | <s5gvh909h6z DOT fsf AT egghead DOT curl DOT com> |
| Mime-Version: | 1.0 |
| X-Mailer: | Mutt 0.95.6i |
| In-Reply-To: | <s5gvh909h6z.fsf@egghead.curl.com>; from Patrick J. LoPresti on Fri, Sep 24, 1999 at 04:40:20PM -0400 |
On Fri, Sep 24, 1999 at 04:40:20PM -0400, Patrick J. LoPresti wrote:
>Just some observations from reading the code and playing with strace.
>Pull up select.cc and follow along.
>
>The peek_pipe() function frequently gets called on the input side of a
>pipe. That causes the call to PeekNamedPipe() to fail with a
>permission error (Win32 only lets you peek at the output side), which
>is kind of annoying. Perhaps peek_pipe() could check read_selected
>before doing the PeekNamedPipe?
Looking at a recent strace output, I don't see any occurrences of
PeekNamedPipe failures. So, I'm not sure where this is frequently being
called.
PeekNamedPipe is supposed to be called with a pipe handle which has
GENERIC_READ attributes. I don't know what you consider the output side
of a pipe but I wouldn't expect an output handle to have GENERIC_READ
attributes.
>Also, there currently seem to be only clunky attempts to enforce the
>invariant that the bits set in the fd_sets when select() returns are
>subsets of the bits which were passed in. (I'm not even certain this
>is always true.) Wouldn't it make sense for the set_bits() function
>to enforce this invariant by checking {read,write,except}_selected
>before setting the corresponding bit? Then many of the read_selected
>tests around the file could be removed.
Hmm. I assume that this paragraph is your "clunky" way of trying to
start a technical discussion. You do realize that when you send mail
here mailing list you stand a chance of communicating with the original
author of the code, right? I'll grant you that the word "clunky" did
get my attention but certainly not in a positive way.
However, you're right that the *_selected test should be in set_bits. I
don't agree that all of the *_selected tests should be eliminated
elsewhere, however.
-chris
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |