IOCP, cross-platform libraries?

I recently came across something called IOCP on the Windows platform, more specifically: I / O control ports. This appears to bethe most efficient way to code your server software when it needs to keep thousands of users at the same time. (Correct me if I'm wrong, but thread-per-socket, polling and asynchronous callbacks (thread for each callback) are not efficient enough.)

I am wondering if there are any third party libraries out there that implement this concept. I know the win32 api supplies us with CreateIoCompletionPort, FreeBSD has kqueue, and linux can generally use / dev / epoll, which works pretty much the same ... But isn't there a cross platform library (such as boost :: thread) that handles this stuff for me?

+1


source to share


3 answers


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



+5


source


I know this is a late answer to this thread, but for anyone interested in an x-platform library that supports async IO on Linux / UNIX and Windows, you might want to take a look at libuv .



libuv was originally created as a foundational node.js framework, but has evolved into a powerful abstraction library for many low-level x-platform issues including async IO, non-blocking TCP sockets and named pipes, UDP, timers, child process, high-res timing, scheduling stream flows, etc.

+2


source


libevent works with multiple * nix operating systems and also works on Windows.

+1


source







All Articles