CMPS 272 Midterm, Fall 2001

American University of Beirut · Operating Systems · 5 pages

All CMPS 272 files
CMPS 272 Midterm, Fall 2001, page 1

Stuck on a question? A tutor can walk you through it.

CMPS 272 Midterm, Fall 2001, page 2 CMPS 272 Midterm, Fall 2001, page 3 CMPS 272 Midterm, Fall 2001, page 4 CMPS 272 Midterm, Fall 2001, page 5

More CMPS 272 files

Show the text of this exam
CMPS 272-Operating Systems Midterm Make-up - Fall 2001-2002 Time: 25 Minutes Walid Keyrouz and Ahmad Nasri Student Id Student Name Instructor Name Signature Question G. General H. Scheduling I. Concurrency ! Total Good Work & Good Luck G. General Questions On early computers, every byte of data read or written was directly handled by the CPU (ie., there was no DMA-Direct Memory Access). What impact did this have on multiprogramming? H. Scheduling Measurements at a certain computer systems have shown that the average CPU burst is T msec. A process con-text requires S msec which is effectively wasted (overhead) time. The efficiency of the scheduling algorithms is defined as the ratio of useful time to total time (i.¢., the percent of time the CPU is doing useful work as opposed to context switching). For a Round Robin schedule with a time quantum Q, give a formula for the efficiency E in terms of Q, T and S for each of the following: 1. Qa J. Concurrency The following program is an attempt to solve the mutual exclusion problem for two processes. #define FALSE 0 #define TRUE 1 #define N 2 void enter_region (int process) { int other; other = 1 - process; interested[process] = TRUE; turn = process; while (interested[other} == TRUE || turn == process) { /* do nothing */ void leave_region (int process} { interested[process] 1. Give a sequence of events that will cause a race condition. 2. Correct the program.