Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Practice Exam 2 - Operating Systems and Networking | CS 330, Exams of Operating Systems

Material Type: Exam; Professor: Sengupta; Class: Operating Systems & Networking; Subject: Computer Information Science; University: SUNY Institute of Technology at Utica-Rome; Term: Spring 2007;

Typology: Exams

Pre 2010

Uploaded on 08/09/2009

koofers-user-bni
koofers-user-bni 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Test 2: Supplementary
Operating Systems and Networking
CS330
Spring 2007
Answer any five questions from below
Date: March 30, 2007
Time: 2 hours.
Policy: Open book, open notes.
1. Suppose that a multiprogrammed system has a load of N processes with individual total
execution time of
N321
t,..,t,t,t
. How would it be possible that the execution time could be
as small as maximum(
N321
t,..,t,t,t
)? How would it be possible that the execution time is
greater than
i
i
tT
?
2. Assume you have on an average n processes in the system and you are using RR scheduling with
time-quantum D units of time. It is assumed that in your system the average context switching
time is C. One could design a performance index for your system in terms of user-satisfaction U
where U could be measured as
U = D/R
where R is the average residence time of jobs in the system. (a) Obtain U in terms of the
parameters given so far. (b) What happens to U when C is infinitely large? (c) When very small?
3. Placement strategies determine where in the main storage incoming programs and data should be
loaded. Suppose a job waiting to begin execution has a storage requirement that can be fulfilled
immediately. Should the job be loaded and begin execution immediately? State your rationale.
4. One pessimistic Operating Systems designer claims that (a) the equilibrium performance of a
system is ultimately invariant of the specific storage allocation scheme (like First Fit, Worst Fit,
etc.) adopted, and (b) the First-fit strategy, notwithstanding its fancy name, is nothing more than a
random storage placement strategy. Comment on them.
5. Why is it easier to communicate between threads in a process than between processes? Why is it
more expensive to context switch in a process domain compared to context switching in thread-
domain?
6. What is the distinction between "deadlock" and "starvation"? Could a process "starve" even
though it does get the CPU periodically? Rationalize your answer.
7. A system has four processes and five different types of allocatable resources. The current
allocation and maximum needs are as follows:
Current allocation Maximum needs Available
Process A 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
Process B 2 0 1 1 0 2 2 2 1 0
Process C 1 1 0 1 0 2 1 3 1 0
Process D 1 1 1 1 0 1 1 2 2 1
pf2

Partial preview of the text

Download Practice Exam 2 - Operating Systems and Networking | CS 330 and more Exams Operating Systems in PDF only on Docsity!

Test 2: Supplementary

Operating Systems and Networking

CS

Spring 2007

Answer any five questions from below

Date: March 30, 2007 Time: 2 hours. Policy: Open book, open notes.

  1. Suppose that a multiprogrammed system has a load of N processes with individual total

execution time of t 1 ,t 2 ,t 3 ,..,tN. How would it be possible that the execution time could be

as small as maximum ( t^1 ,t 2 ,t 3 ,..,tN )? How would it be possible that the execution time is

greater than ^ 

i

T t i?

  1. Assume you have on an average n processes in the system and you are using RR scheduling with time-quantum D units of time. It is assumed that in your system the average context switching time is C. One could design a performance index for your system in terms of user-satisfaction U where U could be measured as U = D/R where R is the average residence time of jobs in the system. (a) Obtain U in terms of the parameters given so far. (b) What happens to U when C is infinitely large? (c) When very small?
  2. Placement strategies determine where in the main storage incoming programs and data should be loaded. Suppose a job waiting to begin execution has a storage requirement that can be fulfilled immediately. Should the job be loaded and begin execution immediately? State your rationale.
  3. One pessimistic Operating Systems designer claims that (a) the equilibrium performance of a system is ultimately invariant of the specific storage allocation scheme (like First Fit, Worst Fit, etc.) adopted, and (b) the First-fit strategy, notwithstanding its fancy name, is nothing more than a random storage placement strategy. Comment on them.
  4. Why is it easier to communicate between threads in a process than between processes? Why is it more expensive to context switch in a process domain compared to context switching in thread- domain?
  5. What is the distinction between " deadlock " and " starvation "? Could a process "starve" even though it does get the CPU periodically? Rationalize your answer.
  6. A system has four processes and five different types of allocatable resources. The current allocation and maximum needs are as follows: Current allocation Maximum needs Available Process A 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1 Process B 2 0 1 1 0 2 2 2 1 0 Process C 1 1 0 1 0 2 1 3 1 0 Process D 1 1 1 1 0 1 1 2 2 1

What is the smallest value of x for which this is a safe state?

  1. Consider the following code fragment: wait (s1); a++; wait(s2); b++; signal(s2); signal(s1); All variables are atomic. Consider two threads running this fragment simultaneously, can there be a deadlock? Why, or why not?
  2. Give two reasons why caches are useful. What problems do they solve? What problems do they cause? If a cache can be made as large as the device for which it is caching, why not make it that large and eliminate that device?