Opentopia Directory Encyclopedia Tools

Asynchronous I/O

Encyclopedia : A : AS : ASY : Asynchronous I/O


-->
[Section>sections].
Please format the article according to the guidelines laid out at
[Manual of Style].

Asynchronous I/O is a form of input/output processing that permits other processing to continue before the transmission has finished.

Input and Output operations on a computer can be extremely slow compared to the processing of data. An I/O device can incorporate mechanical devices which must physically move, such as a hard drive seeking a track to read or write; extremely slow compared to merely moving electrons. For example, during a disk operation that takes ten milliseconds to perform, a processor that is clocked at one gigahertz could have performed ten million instruction-processing cycles.

A simple approach to I/O would be to start the access and then wait for it to complete. But such an approach (called synchronous I/O or blocking I/O) would block the progress of a program while the communications is in progress, leaving system resources idle. When a program makes many I/O operations, this means that the processor can spend almost all of its time idle waiting for I/O operations to complete.

Alternatively, it is possible, but more complicated, to start the communication and then perform processing that does not require that the I/O has completed. This approach is called asynchronous input/output. Any task that actually depends on the I/O having completed (this includes both using the input values and critical operation that claim to assure that a write operation has been completed) still needs to wait for the I/O operation to complete, and thus is still blocked, but other processing which does not have a dependency on the I/O operation can continue.

A great many operating system functions exist to implement asychronous I/O at many levels. In the simplest software solution, the hardware device status is polled at intervals to detect whether the device is ready for its next operation. DMA can greatly increase the efficiency of a polling-based system, and hardware interrupts can eliminate the need for polling entirely. Multitasking operating systems can exploit the functionality provided by hardware interrupts, whilst hiding the complexity of interrupt handling from the user. Spooling was one of the first forms of multitasking designed to exploit asynchronous I/O. Finally, multithreading and explicit asychronous I/O APIs within user processes can exploit asynchronous I/O further, at the cost of extra software complexity.

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: