views:

2964

answers:

2

What is Windows' best I/O event notification facility?

By best I mean something that ...

  1. doesn't have a limit on number of input file descriptors
  2. works on all file descriptors (disk files, sockets, ...)
  3. provides various notification modes (edge triggered, limit triggered)
A: 

There isn't one yet, as far as I am aware. A friend and I are working on an open source Windows epoll implementation (link below) but we're running into issues figuring out how to make it act the same as the Linux implementation.

Current obstacles:

  • In Linux, file descriptors and socket descriptors are interchangeable, but in Windows they are not. Both must be compatible with an epoll implementation.
  • In Windows it's quite tricky to get kernel events... which is how epoll works in Linux. We're guessing that a program using our cross-platform epoll library will run noticeably slower in Windows than Linux.

I'll try to come back and update this post as we make progress with the project.

http://sourceforge.net/projects/cpoll

Xnapid
From the project page for cpoll: "As of 2009-11-12 0:00:00 GMT, this project is no longer under active development."
Peter Hansen
Such a shame, I really wish this was possible on Windows :-(
Beaks
+6  A: 
Chris Smith
MAXIMUM_WAIT_OBJECTS is 64 also on XP and later.
I recommend the 4th option (APCs): Is has no limitation on the number of connections and you don't need to fill any weird arrays like select et al. Just Schedule your async IO using WriteFileEx/ReadFileEx and use SleepEx/WaitFor{Single|Multiple}ObjectsEx to set the thread to an alertable state.
Kosta