On Mon, Feb 10, 2014 at 1:04 PM, Ben Pfaff <b...@nicira.com> wrote:
> On Mon, Feb 10, 2014 at 12:54:50PM -0800, Ben Pfaff wrote:
>> On Mon, Feb 10, 2014 at 11:16:20AM -0800, Gurucharan Shetty wrote:
>> > This is helpful if we want to wait either on 'fd' for POSIX or
>> > events for Windows.
>> >
>> > For Windows, if both 'fd' and 'wevent' is specified, we associate
>> > that event with the 'fd' using WSAEventSelect(). So any 'events'
>> > on that 'fd' will wake us up from WaitForMultipleObjects().
>> >
>> > CC: Linda Sun <l...@vmware.com>
>> > Signed-off-by: Gurucharan Shetty <gshe...@nicira.com>
>>
>> I found the WSAEventSelect() documentation in MSDN really
>> un-enlightening, but I'll take your word for it that this does
>> something helpful.
>
> One thing I did glean from the MSDN documentation is that if you do
> WSAEventSelect() on a fd and then call some other function on that fd,
> the latter can reset what WSAEventSelect() did.  That makes me wonder
> whether we should avoid the resets by calling WSAEventSelect from the
> first HMAP_FOR_EACH loop inside poll_block(), instead of from
> poll_fd_wait_at(), simply to have less opportunity to screw ourselves
> up.  (Also in theory we could reduce the number of calls to
> WSAEventSelect() that way, when we call poll_fd_wait_at() more than
> once on a single fd, but I doubt that's important in practice.)

Yes. I think it is a good idea. I will add it.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to