When an Amiga application requests some data to be read from the filesystem using Read()
, the Amiga has to put that task to sleep and ask the filesystem to fetch the data. The file-system starts up the disk hardware and reads it and after that the operating system wakes up the application. While the filesystem is reading data, the application is idle waiting for the Read()
to complete.
The library in this section is created by Martin Taillefer and uses a double-buffered asynchronous I/O approach to reading and writing data:
OpenAsync
and if the file is opened for reading, OpenAsync
asks the filesystem to start reading data.ReadAsync
and if the asynchronous read has not completed, ReadAsync
will put the application to sleep until that request returns.WriteAsync
.CloseAsync
.This approach is particularly useful with DMA hard-drives which have the ability to transfer data to memory at the same time the CPU is busy executing a task's instructions. A DMA data transfer is parallel so the CPU is operating at full speed and unaffected by the DMA transfer which is what these routines exploit.