Linux Asynch IO - difference between aio.h and libaio.h

后端 未结 2 1017

I have started looking at a new paradigm I didn\'t know called asynch IO in Linux.

My goal is to use async IO targeting sockets to write high-performance efficient serve

2条回答
  •  一个人的身影
    2021-02-06 07:10

    For purpose of network programming, you will want event based I/O, implemented (in most basic form) with select(2) call, and on some systems with poll(), epoll(), kpoll() etc.

    POSIX AIO (of which Linux AIO is an implementation), doesn't necessarily work on sockets (It did at some point in Linux 2.5 codebase, but I can't be certain it's still possible).

    High-performant socket I/O on Unix is instead done in event-based manner, where you process incoming events in a loop. An event can be "socket is ready for write", "socket has new data" etc., then react on them.

提交回复
热议问题