Linux下的AIO网络套接字和零拷贝

时间:2022-12-31 11:03:27

I have been experimenting with async Linux network sockets (aio_read et al in aio.h/librt), and one thing i have been trying to find out is whether these are zero-copy or not. Pretty much all i have read so far discusses file I/O, whereas its network I/O i am interested in.

我一直在试验异步Linux网络套接字(aio_read等在aio.h / librt中),我试图找出的一件事是它们是否为零拷贝。到目前为止,我所阅读的几乎所有内容都讨论了文件I / O,而我感兴趣的是它的网络I / O.

AIO is a bit of a pain to use and i suspect is non-portable, so wondering whether its worth persevering with it. Zero-copy is just about the only advantage (albiet a major one for my purposes) it would have over (non-blocking) select/epoll..

使用AIO有点痛苦,我怀疑它是不便携的,所以想知道它是否值得坚持下去。零复制只是唯一的优势(albiet是我的目的的主要优势)它将超过(非阻塞)select / epoll ..

1 个解决方案

#1


2  

In GLIBC, AIO is implemented using POSIX threads and a regular pread-call. So it's likely more expensive than select or epoll and doing the read or recv yourself.

在GLIBC中,AIO是使用POSIX线程和常规pread-call实现的。因此它可能比选择或epoll更昂贵,并且自己进行阅读或回收。

#1


2  

In GLIBC, AIO is implemented using POSIX threads and a regular pread-call. So it's likely more expensive than select or epoll and doing the read or recv yourself.

在GLIBC中,AIO是使用POSIX线程和常规pread-call实现的。因此它可能比选择或epoll更昂贵,并且自己进行阅读或回收。