What's the difference between event-driven and asynchronous? Between epoll and AIO?

前端 未结 4 1774
隐瞒了意图╮
隐瞒了意图╮ 2020-12-23 02:50

Event-driven and asynchronous are often used as synonyms. Are there any differences between the two?

Also, what is the difference between epoll and

4条回答
  •  暖寄归人
    2020-12-23 02:54

    Lastly, I've read many times that AIO in Linux is horribly broken. How exactly is it broken?

    AIO as done via KAIO/libaio/io_submit comes with a lot of caveats and is tricky to use well if you want it to behave rather than silently blocking (e.g. only works on certain types of fd, when using files/block devices only actually works for direct I/O but those are the tip of the iceberg). It did eventually gain the ability to indicate file descriptor readiness with the 4.19 kernel) which is useful for programs using sockets.

    POSIX AIO on Linux is actually a userspace threads implementation by glibc and comes with its own limitations (e.g. it's considered slow and doesn't scale well).

    These days (2020) hope for doing arbitrary asynchronous I/O on Linux with less pain and tradeoffs is coming from io_uring...

提交回复
热议问题