[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/45334: aio(3) fails with more than request when one of them blocks, or, aio(3) is only asychnornous for one single request
>Synopsis: aio(3) fails with more than request when one of them blocks,
>or, aio(3) is only asychnornous for one single request
>Arrival-Date: Tue Sep 06 08:00:00 +0000 2011
>Originator: Marc Balmer
NetBSD amd64.vnode.ch 5.99.55 NetBSD 5.99.55 (GENERIC) #19: Sun Sep 4 11:58:36
When more than one aio requests are enqueued and one of them blocks, all other
requests are blocked.
do an aio_read() on a listened/accepted socket and a second one on a file or
tty. The second one will only finish once the request on the socket has
The underlying problem is that aio(3) puts all requests in a single queue and
only one worker thread looping over this queue. So if a request blocks, the
worker thread will not process to the next request until the blocking request
aio requests should be handled in parallel, maybe with a proper thread for each
request or some other mechanism.
A simple approach could be to set the filedescriptors internally to nonblocking
and have the worker thread skip the request if it would block.
Main Index |
Thread Index |