Next: Make the foreground process
Up: Assignment 5: Processor Scheduling
Previous: Pit CPU-bound vs. CPU-bound
- 1.
- Modify alarm so that instead of doing only CPU work, it
alternates between bursts of CPU and I/O, where the I/O in this case
will be printing things on the screen. In other words, it should loop
for a little while, print something, loop for a little while, print
something, etc.
- 2.
- Run the experiment again and see if the behavior of the
background process (alarm) affects the amount of CPU time allocated
to the foreground process (loop). Modify alarm so that it does
different amounts of CPU work between each print statement. How
does the frequency of the background process's I/O affect the amount
of CPU time the foreground process gets?
- 3.
- Modify alarm so that instead of doing I/O to the screen it
does I/O to the disk. You can do this internally in alarm, by
using fprintf, or you can do it at the shell level by redirecting
the output from alarm to a file. Does it change your results when
the background process is doing disk I/O instead of screen I/O?
Next: Make the foreground process
Up: Assignment 5: Processor Scheduling
Previous: Pit CPU-bound vs. CPU-bound
Allen B. Downey
3/17/1998