[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] WaitForMultipleObjects backend?



On 03/13/2013 08:18 PM, Nick Mathewson wrote:

Oh, this is going to be a *fun* one!

Yeah, I was afraid of that.

Here's a brain-dump.  I'm not an expert on Windows APIs, so there may
be errors or omissions.

Thanks for the brain dump! I'm afraid I'm in the same boat; I'm a Linux programmer who dabbles in Windows when necessary.

Another thing you could look at for starters is the branch that Chris
Davis tried to write to handle this code.  I don't think it wound up
working completely, but it had some good ideas.  I have it archived in
branch "hybrid-loop2" in my personal repository at
https://github.com/nmathewson/libevent/tree/hybrid-loop2

It probably has some good ideas!

Thanks! I've rebased it (which required some massaging and a bit of guessing) onto the current libevent master branch, and I've fixed it up to the point where it compiles on Windows. That's all can say, though; I've done zero testing (other than a quick run of "regress.exe"). But in case this is useful in any way, it's available as my "hybrid-loop2-updated" branch in my github repo.

I'll probably use this as a starting point for porting my event-based Windows code, and then see what breaks.

Integration with IOCP could be a clever thing here. IOCP->Event and
Event->IOCP signals seem to go pretty fast on windows, whereas mucking
around with stuff like evutil_socketpair() is less so.

I'm afraid I know nothing about IOCP.  I'll have to read up on that.

You're going to run into the 64-event (or is it 63?) limitation of
WaitForMultipleEvents.

Yeah, my existing (non-libevent-based) Windows code presumably has this limitation, too. We just haven't run into it yet, but I'm sure a customer will find a way to run into it when we least expect it.

Thanks again for the brain dump, and I'll keep you updated if I make any further progress!

--Patrick

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.