Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Events in linux

Author: Robert Hyatt

Date: 07:02:26 04/25/01

Go up one level in this thread


On April 25, 2001 at 02:01:15, Hristo wrote:

>On April 24, 2001 at 23:50:37, Robert Hyatt wrote:
>
>>On April 24, 2001 at 22:50:41, Hristo wrote:
>>
>>>select(..) doesn't do it. ;-(((
>>>wish it did!!!!
>>>select(..) works within a different domain and in general
>>>can not compare to WaitForMultipleObjects. ;-(
>>>WaitForMultipleObjects is, kind of like, select(..) on steroids!
>>>...
>>>The unix style is to keep things simple, which pays off when there
>>>is good design!
>>>
>>>hristo
>>
>>
>>why can't you produce the same effect with a group of descriptors?  Writing
>>to such a descriptor from the "other end" will set that condition so that
>>select() will terminate...  IE it seems like a small kludge, but it would
>>seem to allow the same sort of capability...???
>
>How to make sure that all (ALL) descriptors are set before select returns.
>Lets say I want select to return wtith either ALL-descriptors-set or
>NO-descriptors-set? Perhaps it can be done!? For me it's easier to
>think of this problem as a bunch of cond+mutex variables...
>This is what MS can do to ya ... get people spoiled and lazy ...
>and offers complicated solutions ... you use them and then you are stuck,
>because one never takes the time to find the simple, elegant solution.
>
>hristo


This is quite easy.  Select returns a bit vector telling you which descriptors
are "ready".  Compare this to the bit vector _you_ supply telling it which
descriptors are to be tested.  If they are the same, then _all_ are ready.  If
not, exclusive-or them and select again on the result which will test for the
remaining ones to be "ready"..



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.