Oracle Internals Notes

Asynchronous I/O

Asynchronous I/O means non-blocking I/O. If a process attempts to read or write using the normal, synchronous read() or write() system calls, then it must wait until the hardware has completed the physical I/O, so that it can be informed of the success or failure of the operation (and to receive the results in the case of a successful read). The execution of the process is blocked while it waits for the results of the system call. This is synchronous or blocking I/O.

However, if the process instead uses the asynchronous aio_read() or aio_write() system calls (called aioread() and aiowrite() on some operating systems), then the system call will return immediately once the I/O request has been passed down to the hardware or queued in the operating system, typically before the physical I/O operation has even begun. The execution of the process is not blocked, because it does not need to wait for the results of the system call. Instead, it can continue executing and then receive the results of the I/O operation later, once they are available. This is asynchronous or non-blocking I/O.

Asynchronous I/O enables write intensive processes like Oracle's DBWn to make full use of the I/O bandwidth of the hardware by queuing I/O requests to distinct devices in quick succession so that they can be processed largely in parallel. Asynchronous I/O also allows processes performing compute intensive operations like sorts to pre-fetch data from disk before it is required so that the I/O and computation can occur in parallel.

The performance of asynchronous I/O is heavily dependent on the operating system's implementation of the aio_read() and aio_write() system calls. Kernelized asynchronous I/O is greatly preferable to threaded asynchronous I/O but it is only available for raw devices and Quick I/O files.


© Ixora Pty Ltd.   All rights reserved.
05-Apr-2002
Search   Questions   Feedback   Up   Home