Homework 05: Chapter 05 Questions


Due: Thursday, February 16th by 5:59 PM
Assignment ID: hwk05

Header

Please put the following at the top of a flat text file, hwk05.txt:

Homework Questions

Write the answers to the following questions in hwk05.txt:
  1. Practice Exercise 5.2
  2. Exercise 5.9
  3. Exercise 5.13
  4. For lab4, we'll be writing a CPU scheduler simulator for the following algorithms:
    • FCFS
    • SJF
    • STRF
    • Priority
    • Preemptive Priority
    • Round-robin (time quantum = 2)
    In preparation for that lab, calculate "by hand" (i.e., without writing a computer algorithm) the process ID that is selected to run every time that the CPU scheduler is called. Do this for each of the six algorithms listed above. Use processData2.txt for the process information. The columns in process information file are:
    1. Process ID
    2. Arrival time
    3. CPU burst time
    4. Priority (higher = higher priority)

Submission

Submit hwk05.txt using the handin program. For example, for this homework, type the following in a terminal exactly as it appears:
  handin  hwk05  hwk05.txt

Alternatively, you can submit the assignment from any computer via PeerSpace. After successfully logging into PeerSpace, go to Tools, then Assignments. Click on the Submit link.


Hints

  1. For the CPU scheduler problem, using the process data in processData1.txt, the following processes are assigned to run by the CPU scheduler:
    FCFS:  1 2 3 4 5
    SJF:  1 2 4 3 5
    SRTF:  1 2 3 3 4 1 5
    Priority:  1 4 3 5 2
    Preemptive Priority:  1 1 3 4 3 1 5 2
    Round-robin:  1 2 3 4 5 1 5 1 5 1 5 1 5
    Notice that for STRF, process ID 3 is chosen twice in a row.