SUNY Poly CS 521 - Midterm test Analytical Models of Operating Systems

Unformatted text preview:

Midterm testAnalytical Models of Operating SystemsSpring 2006Answer any four from the followingTake home exam.Due date: Monday, March 20, 2006 Please post your answers at [email protected]. It is being claimed that one of the objectives of an operating system is to provide a set of servicesto system users. Surely, a system user may receive all such services by calling appropriateresource routines directly (without going through OS) as library calls. In such situations, anoperating system as a service entity need not be required. Comment on this observation.2. Indicate the rationale for each of the following: a. Users are not allowed to set the interrupting clock for CPU usage. b. FIFO strategy is not an appropriate CPU scheduling scheme for interactive users. c. Deadline scheduling is complex d. In CPU Scheduling, priority to I/O-bound tasks automatically help compute-bound tasks as well.3. Consider two processes shown below which are to run concurrently. You are required to indicate the resultant output. The basic set of constraints is: (a) We don’t know in what order they will run and nor do we know how the execution of these will be interleaved by the dispatcher, (b) The global variables are initialized before any of the programs is run, (c) Every time a variable is referenced it would be obtained from memory, (d) Every time a variable is set (written) it would be done in memory.int m = 0;int n = 0;cobeginA; B;coend;}Process A; Process B;{ {for (; m <3; m++) while (m <3) { {n = 0; if (n = = 1)cout << m; cout << ”p” ; n = 1; }} } What would be the output if processes A and B are now changed to the following codes, respectively:Process A; Process B;{ {while (m = = 0); cout << “q”;cout << “p”; m = 1;n = 1; while (n = = 0);n = 0; cout << “r”; }cout << “s”; n = 1; }4. Two processes are to share resources A and B in mutual exclusion. Show using Petri net formalismhow these processes can be in a deadlock state. Suppose 2 producers and 3 consumers are coupled together via a finite buffer of size 5. Depict the producer/consumer model of the ensemble as a Petri net.5. Consider the following Petri net with the initial marking 0M as indicated. For each marking state kMlisted below, identify the firing sequence of the transitions that would lead to the indicated state starting from 0M if and only if the state kMis reachable from 0M via a transition firing sequence like ktptltMMMMkpl0.a.  01012 ,,,,M b.  11021 ,,,,M c.  11111 ,,,,M d.  11210 ,,,,M 6. (a) What is the difference, if any, between busy waiting and blocking?(b) Consider two processes 1P and 2Prunning in concurrently to do their own portion of critical sections. main ( ) { // global variablesint key[0] = 1;int key[1] = 1;cobeginP(1); P(2);Coend}P1P2P3P5P4t1t2t3t4t5Process P[int i]{while (true) {do_chores; key[i] = 0;while (key[1-i] = = 0);<critical_section>;key[i] = 1;}}Why does this code fail to satisfy the mutual exclusion requirement for critical section?7. What are the differences among (a) long-term, (b) mid-term, and, (c) short-term scheduling? What aspects does each type of scheduling ensure in executing processes? Consider a priority based short-term scheduling system where a priority of a process could be advanced either using aging scheme A or using aging scheme B. What are the relative pros and cons of the suggested schemes?Scheme A. Scheme B.consumed_time_cputime_residencePjob11 consumed_time_cputime_residencePkjob11Assume that the parameter kused here is a non-negative integer. Good Luck to you all! Creative answers would be


View Full Document

SUNY Poly CS 521 - Midterm test Analytical Models of Operating Systems

Download Midterm test Analytical Models of Operating Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Midterm test Analytical Models of Operating Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Midterm test Analytical Models of Operating Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?