State of IOCP work

Marc Lehmann schmorp at schmorp.de
Wed Dec 8 21:03:07 CET 2010


On Wed, Dec 08, 2010 at 02:49:31AM +0100, Bert Belder <H.Belder at student.TUDelft.NL> wrote:
> I think it would be possible to implement a backend for windows that
> *does* support waiting for event handles and iocps. It could use a wait
> function like WaitForMultipleObjectsEx; the stuff select() normally does
> would still be possible by creating a socket readiness event using
> WSAEventSelect.

I looked into this before: WSAEventSelect doesn't support writable
"events", which is the primary show-stopper for this solution.

WaitForMultipleObjectsEx again requires threads, as it only supports
waiting for 64 objects at a time - or something like an IOCP, which again
has a lot of limitations (mostly not working well with socket events on
all socket types, weird rules of ownership, basically resulting in the
requirement for an extra thread and so on).

> What would it take, if ever, for you to accept a patch for this?

The existance of a working patch (or better: separate backend)? The
requirement would simply be that it works with the same types of handles
as before (minus the internal signal pipe), and implements the POSIX event
model to the application.

If you manage to do that, you'd be the first ever to have managed that - a
good number of people have tried (including me :), and windows always has a
catch somewhere that makes it impossible.

Maybe there is a way, maybe by relying on undocumented behaviour (for
example, to rearm FD_WRITE events), and if there is, I'd be rather curious
to learn about it, and understand it.

At the moment, though, I am rather skeptical, especially since different
handle types seem to react vastly different on windows (iocps/events look
like some big pile of random hacks to me).

So, sure, go on and prove the rest of the world wrong.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list