1. Compare the prefetching scheme with spooling where the CPU overlaps the input of one job with the computation and of other jobs.
( Prefetching is a method of overlapping the I/O of a job with that job’s own computation. After a read operation completes and the job is about to start operating on the data, the input device is instructed to begin the next read immediately. The CPU and input device are then both busy. With luck, by the time that the job is ready for the next data item, the input device will have finished reading that data item. The CPU can then begin processing the newly read data, while the input device starts to read the following data. While Spooling is the process of a sending data to a spool, or temporary storage area in the computer's memory. This data may contain files or processes. Like a spool of thread, the data can build up within the spool as multiple files or jobs are sent to it. However, unlike a spool of thread, the first jobs sent to the spool are the first ones to be processed. These two tries to keep both CPU and I/O busy, so as to improve the performance of the system, while differs as to where each of the scheme is based; prefetching is a user-based activity, while spooling is a system-based activity.
2. What are the differences between a trap and an interrupt? What is the use of each other?
( An interrupt is generally initiated by an I/O device, and causes the CPU to stop what it is doing, save its context, jump to the appropriate interrupt service routine, complete it, restore the context, and continue execution. For example, a serial device may assert the interrupt line and then place an interrupt vector number on the data bus. The CPU uses this to get the serial device interrupt service routine, which it then executes as above. A trap is usually initiated by the CPU hardware. When ever the trap condition occurs (on arithmetic overflow, for example), the CPU stops what it's doing, saves the context, jumps to the...
Please join StudyMode to read the full document