Linux and I/O completion ports?

2019-01-12 18:07发布

Using winsock, you can configure sockets or seperate I/O operations to "overlap". This means that calls to perform I/O are returned immediately, while the actual operations are completed asynchronously by separate worker threads.

Winsock also provides "completion ports". From what I understand, a completion port acts as a multiplexer of handles (sockets). A handle can be demultiplexed if it isn't in the middle of an I/O operation, i.e. if all its I/O operations are completed.

So, on to my question... does linux support completion ports or even asynchronous I/O for sockets?

7条回答
倾城 Initia
2楼-- · 2019-01-12 19:05

Read the blog entry from Google on libevent, you can implement IOCP semantics on Unix using asynchronous IO but cannot directly implement asynchronous IO semantics using IOCP,

http://google-opensource.blogspot.com/2010/01/libevent-20x-like-libevent-14x-only.html

For an example cross platform asynchronous IO with a BSD socket API look at ZeroMQ as recently published on LWN.net,

http://www.zeromq.org/

LWN article,

http://lwn.net/Articles/370307/

查看更多
登录 后发表回答