Docsity

CSE 430/598 Summer 94 Final Exam - CPU Scheduling, Banker's Algorithm, Memory Management, Exams of Operating Systems

Toggle sidebar
bg1
CSE 430/598
SUMMER 94 FINAL EXAM NAME
(30) 1. Given the following jobs:
Job # Arrival Time Run Time Priority (1 is highest)
1 0 6 4
2 1 4 2
3 3 3 1
4 4 2 3
(18) (a) Draw a Gantt chart to illustrate the execution of these jobs for each of the following 6
CPU scheduling algorithms: Nonpreemptive SJF; Preemptive SJF; Round Robin with q=3
Make the following assumptions to handle 'ties.' In Preemptive SJF, an arriving job must have
less time than the remaining burst time of a running job in order to preempt it. In Round Robin,
if a job arrives at exactly the same time as another uses up its time quantum, the algorithm
doesn't specify which job precedes the other at the tail of the queue, i.e., you can solve the
problem using either one of these assumptions.
(5) (b) What is the average waiting time for Round Robin?
(5) (c) What is the average turnaround time for Preemptive Shortest Job First?
(2) (d) What is aging and why is it used?
pf3
pf4

Partial preview of the text

Download CSE 430/598 Summer 94 Final Exam - CPU Scheduling, Banker's Algorithm, Memory Management and more Exams Operating Systems in PDF only on Docsity!

CSE 430/

SUMMER 94

FINAL EXAM

NAME

(30) 1. Given the following jobs: Job # Arrival Time Run Time Priority (1 is highest) 1 0 6 4 2 1 4 2 3 3 3 1 4 4 2 3 (18) (a) Draw a Gantt chart to illustrate the execution of these jobs for each of the following 6 CPU scheduling algorithms: Nonpreemptive SJF; Preemptive SJF; Round Robin with q= Make the following assumptions to handle 'ties.' In Preemptive SJF, an arriving job must have less time than the remaining burst time of a running job in order to preempt it. In Round Robin, if a job arrives at exactly the same time as another uses up its time quantum, the algorithm doesn't specify which job precedes the other at the tail of the queue, i.e., you can solve the problem using either one of these assumptions. (5) (b) What is the average waiting time for Round Robin? (5) (c) What is the average turnaround time for Preemptive Shortest Job First? (2) (d) What is aging and why is it used?

CSE 430/

SUMMER 94

FINAL EXAM

NAME

(30) 2. Consider the following snapshot of a computer system. ALLOCATION MAXIMUM AVAILABLE R 1 R 2 R 1 R 2 R 1 R 2 P 1 1 1 P 1 3 2 1 1 P 2 1 1 P 2 4 3 P 3 1 1 P 3 5 4 P 4 1 1 P 4 1 1 Answer the following questions using the Banker's Algorithm for deadlock avoidance. For full credit on parts b, c and d, if you believe that the system is in a safe state or that the request can be granted, you must show a safe sequence and if you believe that the system is not in a safe state or that the request cannot be granted, you must demonstrate why this is so. (a) What are the contents of the NEED array. (b) Is the system in a safe state? (c) Suppose P 3 requests one additional instance of R 2 , can the request be granted? (d) Starting again from the original snapshot, suppose P 3 requests one additional instance of R 1 , can the request be immediately granted?

CSE 430/

SUMMER 94

FINAL EXAM

NAME

Questions 4 through 9 are worth (1 point each)

  1. T or F Semaphores can be implemented with monitors.
  2. T or F Monitors can be implemented with semaphores.
  3. T or F Critical regions can be implemented with monitors.
  4. T or F Monitors can be implemented with critical regions.
  5. T or F Semaphores can be implemented with critical regions.
  6. T or F Critical regions can be implemented with semaphores.
  7. There is no best page size for all applications. Various factors affect it. For each of the following considerations by itself would it be better to have a large page size or a small page size? (4 points) (a) fragmentation (b) page table size (c) i/o overhead (d) page faults