Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Sat, 25 Sep 1999 13:33:49 -0400 To: "Patrick J. LoPresti" 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" , cygwin AT sourceware DOT cygnus DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: ; 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