什么是POSIX异步I / O(AIO)的状态? [英] What is the status of POSIX asynchronous I/O (AIO)?

查看:195
本文介绍了什么是POSIX异步I / O(AIO)的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有描述POSIX AIO设施的细节变化量分散各地的网络页面。他们都不是可怕的最近。目前还不清楚,究竟是什么,他们描述。例如,官方(?)网站了解Linux内核的异步I / O支持这里说,插座不工作,但我的Ubuntu 8.04.1工作站上的aio.h手册页似乎都在暗示,它适用于任意文件描述符。此外,还有另一个项目,似乎在库层用更少的文档工作。

There are pages scattered around the web that describe POSIX AIO facilities in varying amounts of detail. None of them are terribly recent. It's not clear what, exactly, they're describing. For example, the "official" (?) web site for Linux kernel asynchronous I/O support here says that sockets don't work, but the "aio.h" manual pages on my Ubuntu 8.04.1 workstation all seem to imply that it works for arbitrary file descriptors. Then there's another project that seems to work at the library layer with even less documentation.

我想知道:


  • 什么是POSIX AIO的目的是什么?鉴于我能找到的说,它不支持套接字实现的最明显的例子,整个事情似乎怪我。难道仅仅是为异步磁盘I / O?如果是这样,为什么超一般API?如果没有,为什么是磁盘I / O资源被攻击的第一件事?

  • 哪里有例子的完整的POSIX AIO的程序,我可以看看?

  • 有没有人真正使用它,是真的吗?

  • 哪些平台支持POSIX AIO?它们支持哪些部分呢?有谁真正支持暗示任何I / O任何FD的< aio.h> 似乎承诺

  • What is the purpose of POSIX AIO? Given that the most obvious example of an implementation I can find says it doesn't support sockets, the whole thing seems weird to me. Is it just for async disk I/O? If so, why the hyper-general API? If not, why is disk I/O the first thing that got attacked?
  • Where are there example complete POSIX AIO programs that I can look at?
  • Does anyone actually use it, for real?
  • What platforms support POSIX AIO? What parts of it do they support? Does anyone really support the implied "Any I/O to any FD" that <aio.h> seems to promise?

提供给我其他的复用机制是非常好的,但信息的随机片段漂浮在那里已经让我很好奇。

The other multiplexing mechanisms available to me are perfectly good, but the random fragments of information floating around out there have made me curious.

推荐答案

网络I / O是不AIO的一个优先事项,因为每个人都写POSIX的网络服务器采用了基于事件,非阻塞的方法。旧式的Java亿万阻止线程的办法吸可怕的。

Network I/O is not a priority for AIO because everyone writing POSIX network servers uses an event based, non-blocking approach. The old-style Java "billions of blocking threads" approach sucks horribly.

磁盘写入I / O已经缓冲和磁盘读取I / O可以pfetched到使用功能,如posix_fadvise缓冲$ P $。这使得直接,无缓冲磁盘I / O为AIO的唯一用处。

Disk write I/O is already buffered and disk read I/O can be prefetched into buffer using functions like posix_fadvise. That leaves direct, unbuffered disk I/O as the only useful purpose for AIO.

直接,无缓冲的I / O仅用于事务处理数据库真的很有用,而那些倾向于写自己的线程或进程来管理他们的磁盘I / O。

Direct, unbuffered I/O is only really useful for transactional databases, and those tend to write their own threads or processes to manage their disk I/O.

所以,在留下POSIX AIO在没有服务的任何有用的目的的位置结束。不要使用它。

So, at the end that leaves POSIX AIO in the position of not serving any useful purpose. Don't use it.

这篇关于什么是POSIX异步I / O(AIO)的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆