Ceng 328 Operating Systems
Midterm
March 31, 2010 12.40-14.30
Good Luck!
Answer all the questions.
  1. (15 pts) Choose only two questions.
    i
    What are the main differences between operating systems for mainframe computers and personal computers?
    ii
    What is multiprogramming? Describe and compare single programming and pure multiprogramming.
    iii
    What is the purpose of the command interpreter? Why is it usually separate from the kernel?
    iv
    Regarding job scheduling, what is convoy effect?
  2. (25 pts) Choose only three questions.
    v
    Name and describe the different states that a process can exist in at any given time.
    vi
    Explain the main differences between a short-term and long-term scheduler.
    vii
    Explain the difference between an I/O-bound process and a CPU-bound process.
    viii
    List the four major categories of the benefits of multithreaded programming. Briefly explain each.
  3. (10 pts) What is the purpose of system calls? For each of the following system calls, give a condition that causes it to fail: fork and exec.


















  4. (10 pts) There are two different levels at which threads can be implemented. What are they and how do they differ? What advantages and disadvantages do each have?
  5. (20 pts) Consider the following set of processes, with the length of the CPU-burst time given in milliseconds. Arrival time is the time at which the process is added to the ready queue.
    Process Burst Time Arrival Time
    P1 20 0
    P2 1 0
    P3 6 0
    P4 8 0
    P5 4 8
    P6 2 12
    ix
    Draw appropriate charts illustrating the execution of these processes using FCFS, SJF non-preemptive (SJF-non), and SJF preemptive (SJF-pre).
    x
    Calculate the wait (W) and turnaround (T) times of each process for each strategy. Also calculate the average wait and turnaround times under each strategy.
    FCFS FCFS SJF-non SJF-non SJF-pre SJF-pre
    W T W T W T
    Process Time Time Time Time Time Time
    P1
    P2
    P3
    P4
    P5
    P6
    Average






    xi
    Discuss which strategy is the best according to the table.
  6. (10 pts) What is a ``Critical Region (Section)''? List and explain the conditions that need to be satisfied to solve the critical region problem?
  7. (15 pts) What is ``Mutual Exclusion''? Describe the ``Strict Alternation'' as a solution for mutual exclusion (see the figure)?
    Figure 1: Strict alternation for achieving mutual exclusion, (a) process0 (b) process1.
    \includegraphics[scale=0.7]{figures/strictalternation.ps}


Cem Ozdogan 2010-03-30