Spooling and Buffering: Difference between revisions
pc>Yuron No edit summary |
W81054ch [PHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs) m (1 revision imported) |
(No difference)
|
Latest revision as of 10:03, 5 August 2019
Depends on | Queues |
---|
Spooling
Spooling is a form of buffering typified by printer spooling. A printer is a slow device which is usually also a shared resource. Rather than provide a printer for every machine, ‘the printer’ can be a virtual process.
The spooler accepts print jobs, ensuring the integrity of each. These are queued – possibly including some priority ordering – and output, probably using a printer Daemon or similar strategy. (This is an everyday example of a batch scheduling job.)
A spooler can be used to add information, such as a header page identifying who sent the job on printing, if desired.
Buffering
General buffering strategies are covered here. In I/O buffering there are sometimes other requirements: one example is double buffering.
Imagine sending translating a serial I/O stream into a disk output (which consists, necessarily, of blocks. A block write can be initiated when a block buffer is full; that then takes some time, during which more characters may arrive … and have to go somewhere.
A typical approach is to have a double buffer: fill one buffer then schedule that for writing whilst beginning to fill the other one. As long as the block write is complete before the second buffer is full, nothing needs to stall. When the second buffer is full the buffers can be swapped again and the process continue.
Another example of double buffering occurs in animated video games. The screen being viewed is one buffer and needs to remain stable; another buffer will be being drawn concurrently (this is the time-consuming bit!). When the second buffer is ready the two can be swapped and the ‘spare’ one cleared and recycled.
In practice it is important in a video game that the frame buffer swaps happen at a constant rate and these are synchronised with the output which is maintaining the screen. Thus the output rate will be an integer division of the output frame rate. The buffer swap process will be triggered by an interrupt from the video driver and the drawing process has a hard real-time constraint to meet this. We thought you’d like to know.
Also refer to: | Operating System Concepts, 10th Edition: Chapter 12.4.1-12.4.4, pages 508-511 |
---|