Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Fri, 18 May 2001 14:41:19 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: [CYGWIN] Re: SIGTERM does not stop backend postgres processes immediately Message-ID: <20010518144119.A8011@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3AFF4B61 DOT 39A0B754 AT tpf DOT co DOT jp> <20010509094031 DOT A87424 AT enteract DOT com> <20010509142629 DOT J355 AT dothill DOT com> <20010509164926 DOT C3169 AT redhat DOT com> <3AFF4B61 DOT 39A0B754 AT tpf DOT co DOT jp> <20010513231432 DOT A5059 AT redhat DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20010518110716 DOT 01b581e8 AT pop3 DOT cris DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: <5.1.0.14.2.20010518110716.01b581e8@pop3.cris.com>; from rrschulz@cris.com on Fri, May 18, 2001 at 11:23:30AM -0700 On Fri, May 18, 2001 at 11:23:30AM -0700, Randall R Schulz wrote: >Here's a snippet from the Linux section 2 manual page: > >... >int select(int n, fd_set *readfds, fd_set *writefds, fd_set >*exceptfds, struct timeval *timeout)); >... >timeout is an upper bound on the amount of time elapsed before select >returns. It may be zero, causing select to return immediately. >If timeout is NULL (no timeout), select can block indefinitely. >... > >Does the indefinite-timeout variant of select exist and work under Cygwin >(or Windows, as the case may be) compatibly with the Linux API spec? > >If so, why not use this variant of select? I agree with you, Chris, that >polling is very much to be avoided, but as work-arounds go, this approach >might be acceptable to me. Corinna already supplied a patch to rectify this behavior so this is a non-issue. To answer your specific question, however, cygwin implements select() itself. It isn't a Windows function (although it is a winsock function). To make select interruptible by Cygwin signals, it is sometimes necessary to use polling. I was actually wrong about polling in the case of sockets. You don't have to poll but, if you use the current method, you would have to create a separate thread. That's pretty expensive, too. cgf -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple