Announcement

Collapse
No announcement yet.

Linux Kernel To Get AIO Performance Improvements

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    It's also much more complex and so bug-prone.

    Okay, so say you're doing a lot of writing of files to a slow HDD. What do you gain from AIO when compared to regular O_NONBLOCK?

    Comment


    • #17
      Originally posted by curaga View Post
      It's also much more complex and so bug-prone.
      It only feels complex if you are not used to. Programming with multiple threads is also more complex than single-threaded applications. But the benefit is worth the effort.
      I have worked with big projects which used blocking I/O and with ones that used a completely asynchronous approach. In the end the asynchronous design was accepted by much more developers because they saw the benefit.

      IMHO it is not hard to develop programs which use an asynchronous I/O approach. The main reason that a lot of people think it is more complex and bug-prone is because pretty much ALL examples of I/O (sockets or files) are blocking and it is hard to find good examples of the async way. That's why everbody starts with blocking I/O until they find out that it is not the best solution.

      I can encourage everybody who is interested in the topic to look at the boost::asio library which is an excellent platform-independent API for asynchronous I/O. (but no async file I/O on linux)

      Originally posted by curaga View Post
      Okay, so say you're doing a lot of writing of files to a slow HDD. What do you gain from AIO when compared to regular O_NONBLOCK?
      Actually I didn't try out if the O_NONBLOCK-flag does work properly with files on Linux. But even when it returns EWOULDBLOCK when the operation would block, you still don't know when you can call it again and when the operation would complete without blocking (select or epoll won't work). You still have to work around the same problems as with blocking I/O.

      Comment

      Working...
      X