OS Unit - 4 Part-2 ch13
OS Unit - 4 Part-2 ch13
Synchronous Asynchronous
Vectored I/O
Vectored I/O allows one system call to perform multiple I/O
operations
For example, Unix readve() accepts a vector of multiple
buffers to read into or write from
This scatter-gather method better than multiple individual I/O
calls
Decreases context switching and system call overhead
Some versions provide atomicity
Avoid for example worry about multiple threads
changing data as reads / writes occurring
Kernel I/O Subsystem
Scheduling
Some I/O request ordering via per-device queue
Some OSs try fairness
Some implement Quality Of Service (i.e. IPQOS)
Buffering - store data in memory while transferring between devices
To cope with device speed mismatch
To cope with device transfer size mismatch
To maintain “copy semantics”
Double buffering – two copies of the data
Kernel and user
Varying sizes
Full / being processed and not-full / being used
Copy-on-write can be used for efficiency in some cases
Device-status Table
Kernel I/O Subsystem
Caching - faster device holding copy of data
Always just a copy
Key to performance
Sometimes combined with buffering
Spooling - hold output for a device
If device can serve only one request at a time
i.e., Printing
Device reservation - provides exclusive access to a device
System calls for allocation and de-allocation
Watch out for deadlock
Error Handling