aio

File ./ib_logfile101: 'aio write' returned OS error 122

試著忘記壹切 提交于 2019-12-05 10:23:26
I'm trying to install MySQL 5.6.14 on Ubuntu 12.04 Desktop: $ scripts/mysql_install_db --no-defaults --force \ --explicit_defaults_for_timestamp --datadir=/tmp/data And I'm getting: Installing MySQL system tables... 2013-10-09 09:27:26 6463 [Warning] Buffered warning: Changed limits: max_open_files: 4096 (requested 5000) 2013-10-09 09:27:26 6463 [Warning] Buffered warning: Changed limits: table_cache: 1967 (requested 2000) 2013-10-09 09:27:26 6463 [Note] InnoDB: The InnoDB memory heap is disabled 2013-10-09 09:27:26 6463 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2013-10-09 09

Java NIO windows implementation

随声附和 提交于 2019-12-05 02:58:37
问题 While working on a project using the the NIO.2 AIO features I looked in the "old" NIO selector implementation and saw that on windows the default select-function is used which does not scale at all on windows due to a bad internal implementation. Everybody knows that on windows IOCP is the only real solution. Of course the callback-on-completion model does not fit into the NIO selector model but does this effectively mean that using NIO on windows is basically not a good idea ? For instance:

AIO on OS X vs Linux - why it doesn't work on Mac OS X 10.6

不问归期 提交于 2019-12-05 02:03:50
问题 My question is really simple. Why the code below does work on Linux, and doesn't on Mac OS X 10.6.2 Snow Leopard. To compile save the file to aio.cc, and compile with g++ aio.cc -o aio -lrt on Linux, and g++ aio.cc -o aio on Mac OS X. I'm using Mac OS X 10.6.2 for testing on a Mac, and Linux kernel 2.6 for testing on Linux. The failure I see on OS X is aio_write fails with -1 and sets errno to EAGAIN, which simply means "Resource temporarily unavailable". Why is that? extern "C" { #include

Asynchronous I/O Linux

随声附和 提交于 2019-12-04 19:20:04
Need an async I/O Processing Plan to use async I/O through aio* calls on Linux The situation: I have opened socket with AF_INET and SOCK_STREAM flags (TCP) Have limit high watermark for send buffers Want to write to that socket asynchronously, and when send buffer overflows, want to disconnect an socket So, I have questions: When I made async call to aio_write on TCP socket, when I/O completion will arrives - when buffer written out into socket buffer or delivery is confirmed? How I can manage this behavior? How's best to handle this with lio_listio techniques Regards, Andrew You want to avoid

AIO support on Linux

浪尽此生 提交于 2019-12-04 16:26:27
Does anyone know where I can get up to date information about the state on Kernel support for aio on the latest Linux Kernel?. Google searches bring up web pages that may be hopelessly out of date. Edit: More specifically, I am interested in non-file related descriptors like pipes and sockets. Stuff on the web indicate that there is no support, is this still the case? Edit2: What I am looking for is something similar to Windows OVERLAPPED IO AIO support has been included in the linux kernel proper. That's why the first hit on Google only offers patches to the 2.4 Linux kernel. In 2.6 and 3.0

NIO、BIO、AIO

坚强是说给别人听的谎言 提交于 2019-12-04 11:28:14
BIO(同步阻塞): Socket编程就是 BIO ,操作时会阻塞线程,并发处理能力低 。阻塞的原因在于:操作系统允许的线程数量是有限的,多个socket申请与服务端建立连接时,服务端不能提供相应数量的处理线程,没有分配到处理线程的连接就会阻塞等待或被拒绝。    NIO(同步非阻塞): 是对BIO的改进 ,基于Reactor模型 。bio在传输数据时大部分时间这个“ 数据通道”是空闲的,但还是占用着线程。NIO改进的就是“一个请求一个线程”,在连接到服务端的众多 socket中,只有需要进行 IO操作的才能获取服务端的处理线程进行 IO 。这样就不会因为线程不够用而限制了socket的接入。    AIO(异步非阻塞): 这种 IO模型 是由操作系统先完成了客户端请求处理再通知服务器去启动线程进行处理 。 AIO也称 NIO2.0 , 在 JDK7开始支持 。 阻塞与非阻塞 :主要指的是访问 IO 的线程是否会阻塞(或者说是等待)    阻 塞 :请求资源时,线程只有等到资源就绪之后才去做其他事情    非阻塞 :请求资源时,资源没准备好就先去做其他事情,过一会又来访问,直到资源准备好为止    同步和异步 :主要是指的数据的请求方式,同步和异步是指访问数据的一种机制    同 步 :请求资源时,直到资源准备就绪获取到结果之后才返回    异 步 :请求资源后

Linux async (io_submit) write v/s normal (buffered) write

元气小坏坏 提交于 2019-12-04 08:25:26
Since writes are immediate anyway (copy to kernel buffer and return), what's the advantage of using io_submit for writes? In fact, it (aio/io_submit) seems worse since you have to allocate the write buffers on the heap and can't use stack-based buffers. My question is only about writes, not reads. EDIT: I am talking about relatively small writes (few KB at most), not MB or GB, so buffer copy should not be a big problem. Copying a buffer into the kernel is not necessarily instantaneous. First the kernel needs to find a free page. If there is none (which is fairly likely under heavy disk-write

Linux kernel AIO, open system call

我只是一个虾纸丫 提交于 2019-12-03 23:58:35
Why Linux Kernel AIO does not support async 'open' system call? Because 'open' can block on filesystem for long time, cant it? First off, this is a perfectly fine and legitimate question; the downvote was unfortunate, it probably pushed away people more knowledgeable than I am. AFAICT, there is no good reason. The discussion you managed to dig up is relevant, but not satisfactory at all (which is probably your conclusion as well). Though Torvald's points are technically correct, they clearly dismiss the elephant in the room -- GUI programming -- as well as many other use-cases I'm sure. Yes,

Java NIO windows implementation

萝らか妹 提交于 2019-12-03 21:23:17
While working on a project using the the NIO.2 AIO features I looked in the "old" NIO selector implementation and saw that on windows the default select-function is used which does not scale at all on windows due to a bad internal implementation. Everybody knows that on windows IOCP is the only real solution. Of course the callback-on-completion model does not fit into the NIO selector model but does this effectively mean that using NIO on windows is basically not a good idea ? For instance: The new AIO features include an IOCP implementation. This is especially true while using the latest

Linux AIO: Poor Scaling

只谈情不闲聊 提交于 2019-12-02 23:22:29
I am writing a library that uses the Linux asynchronous I/O system calls, and would like to know why the io_submit function is exhibiting poor scaling on the ext4 file system. If possible, what can I do to get io_submit not to block for large IO request sizes? I already do the following (as described here ): Use O_DIRECT . Align the IO buffer to a 512-byte boundary. Set the buffer size to a multiple of the page size. In order to observe how long the kernel spends in io_submit , I ran a test in which I created a 1 Gb test file using dd and /dev/urandom , and repeatedly dropped the system cache