X-Spam-Check-By: sourceware.org
Date: Mon, 9 Oct 2006 14:39:35 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: How to select on a win32 handle?
Message-ID: <20061009123935.GG13105@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20061007025233.GA24180@sellafield.lysator.liu.se> <20061009085518.GD13105@calimero.vinschen.de> <20061009100420.GC23365@arnhem.lysator.liu.se>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20061009100420.GC23365@arnhem.lysator.liu.se>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Oct  9 12:04, Peter Ekberg wrote:
> On Mon, Oct 09, 2006 at 10:55:18AM +0200, Corinna Vinschen wrote:
> >           To implement a POSIX select function which allows to select on
> > any descriptor one needs to implement it specificially for each known,
> > resp. useful file type.  Naturally this won't work with a generic
> > Windows handle since Cygein doesn't know what it represents.  So Cygwin
> > is unable to provide a matching select function.
> 
> I assumed that cygwin as a last step issued a WaitFor... on the underlying
> win32 handles associated with the fds in its select implementation. Perhaps
> this assumption was wrong? But if not, it would be neat to somehow add an
> extra win32 handle to the array, that would break out of the cygwin select
> when the win32 handle is signaled.

Take a look into winsup/cygwin/select.cc.  There's no generic way to
select on an arbitrary Windows handle without knowledge about its task.

Selecting manually, for instance by creating a thread which calls WFMO,
is the only useful choice, IMHO.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

