Asynchronous I/O: Difference between revisions

Content deleted Content added
KolbertBot (talk | contribs)
m Bot: HTTP→HTTPS (v478)
mNo edit summary
Line 9:
Alternatively, it is possible to start the communication and then perform processing that does not require that the I/O be completed. This approach is called asynchronous input/output. Any task that depends on the I/O having completed (this includes both using the input values and critical operations 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 that does not have a dependency on the I/O operation can continue.
 
Many operating system functions exist to implement asynchronous I/O at many levels. In fact, one of the main functions of all but the most rudimentary of [[operating systems]] is to perform at least some form of basic asynchronous I/O, though this may not be particularly apparent to the operatoruser or the programmer. In the simplest software solution, the hardware device status is [[Polling (computer science)|polled]] at intervals to detect whether the device is ready for its next operation. (For example, the [[CP/M]] operating system was built this way. Its [[system call]] semantics did not require any more elaborate I/O structure than this, though most implementations were more complex, and thereby more efficient.) [[Direct memory access]] (DMA) can greatly increase the efficiency of a polling-based system, and [[hardware interrupt]]s can eliminate the need for polling entirely. [[Computer multitasking|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, [[Thread (computer science)|multithreading]] and explicit asynchronous I/O [[API]]s within user processes can exploit asynchronous I/O further, at the cost of extra software complexity.
 
Asynchronous I/O is used to improve throughput, latency, and/or responsiveness.