Question

I've recently bumped into something called IOCP on the windows platform, to be more precise: Input/Output Control Ports. This seems to be the most efficient way to code your server software when it needs to hold thousands of users concurrently. (Correct me if I'm wrong, but thread-per-socket, polling, and asynchronous callbacks (thread on every callback) are not efficient enough.)

I am wondering if there are any 3rd party libraries available that implement this concept. I know the win32 api supplies us with CreateIoCompletionPort, FreeBSD has kqueue and linux in general can use /dev/epoll that works somewhat similarly... But isn't there a crossplatform library (such as boost::thread) that handles this stuff for me?

Was it helpful?

Solution

Have you looked at boost::asio? I'm not sure if it has all this functionality yet, but I believe that's one of the things it's intended for.

OTHER TIPS

I know this is a late reply to this thread, but for those interested in a x-platform library supporting async IO on both Linux/UNIX and Windows, you might want to take a look at libuv.

libuv was initially constructed as the foundational underpinnings of node.js, but it has evolved to become a powerful abstraction library for many low-level, x-platform concerns including async IO, non-blocking TCP sockets & named pipes, UDP, timers, child process spawning , high resolution time, thread pool scheduling, etc.

libevent works on a number of *nix OSes and also runs on Windows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top