AIO network sockets and zero-copy under Linux
Asked Answered
B

1

7

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.

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..

Bremen answered 4/6, 2010 at 0:9 Comment(2)
AIO seems to be part of POSIX.1-2001, so it should be portable.Latoshalatouche
POSIX/glibc AIO (-lrt and aio_* functions) and Linux AIO (-laio with io_* functions) are two different things. The former is portable, but the latter is not. See Google's AIO User Guide.Jenks
A
3

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.

Ariminum answered 5/6, 2010 at 21:36 Comment(1)
Bit surprising that, though i suppose with current hardware (and some fancy paging tricks?) wire speeds become a bottleneck before memcopy-bandwidth of kernel calls does..Bremen

© 2022 - 2024 — McMap. All rights reserved.