delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/25/13:56:22

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: patl AT cag DOT lcs DOT mit DOT edu (Patrick J. LoPresti)
To: Chris Faylor <cgf AT cygnus DOT com>
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Observations on select.cc (19990922 snapshot)
References: <s5gvh909h6z DOT fsf AT egghead DOT curl DOT com> <19990925133349 DOT A18980 AT cygnus DOT com>
Date: 25 Sep 1999 13:55:26 -0400
In-Reply-To: Chris Faylor's message of "Sat, 25 Sep 1999 13:33:49 -0400"
Message-ID: <s5g1zbmzxip.fsf@egghead.curl.com>
Lines: 44
X-Mailer: Gnus v5.6.27/Emacs 20.3

>>>>> "cgf" == Chris Faylor <cgf AT cygnus DOT com> writes:

 cgf> Looking at a recent strace output, I don't see any occurrences
 cgf> of PeekNamedPipe failures.  So, I'm not sure where this is
 cgf> frequently being called.

It happens any time anyone does a select() to see if they can write to
a pipe.  The "always_ready" test in select() succeeds, and select()
then calls sellect_stuff::poll().  This loops through all of the
select records, calling s->poll() on each.  For a pipe, this means
calling poll_pipe() as decided by fhandler_pipe::select_write() (or
fhandler_pipe::select_read() if the pipe was in both the read and
write fd_sets).

 cgf> PeekNamedPipe is supposed to be called with a pipe handle which
 cgf> has GENERIC_READ attributes.  I don't know what you consider the
 cgf> output side of a pipe but I wouldn't expect an output handle to
 cgf> have GENERIC_READ attributes.

By "output side" I meant the side of the pipe out of which data are
coming.  Sorry for being ambiguous.

 cgf> Hmm.  I assume that this paragraph is your "clunky" way of
 cgf> trying to start a technical discussion.  You do realize that
 cgf> when you send mail here mailing list you stand a chance of
 cgf> communicating with the original author of the code, right?  I'll
 cgf> grant you that the word "clunky" did get my attention but
 cgf> certainly not in a positive way.

Sorry; I meant no offense!  I did not mean that the code is bad.  I
just meant that when I tried to convince myself that this particular
invariant was enforced, I found it difficult; and at the same time, I
saw a way to make it easy.  I will try to use less loaded words when
describing trivial problems.

 cgf> However, you're right that the *_selected test should be in
 cgf> set_bits.  I don't agree that all of the *_selected tests should
 cgf> be eliminated elsewhere, however.

Personally, I would either enforce the invariant everywhere and then
*ASSERT* it in set_bits(); or I would enforce it in set_bits() and not
bother elsewhere.  Naturally, your tastes may differ :-).

 - Pat

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019