Professional Documents
Culture Documents
May/June - 2012
S.1
Set-1
Solutions
OPERATING SYSTEMS
( Common to Information Technology, Computer Science and Engineering )
Time: 3 Hours
Max. Marks: 75
Answer any FIVE Questions
All Questions carry equal marks
---
1.
2.
3.
4.
5.
6.
7.
(a)
(b)
(a)
(b)
(c)
(a)
(b)
(a)
(b)
(c)
(a)
(b)
(c)
(a)
(b)
(a)
(b)
Burst time
P1
10
P2
29
P3
P4
P5
12
Consider the FCFS and RR(quantum = 10 milliseconds) scheduling algorithms for this set of processes and
schedule them. Find the average waiting time for each algorithm provide Gnatt charts. Find which algorithm
would give the minimum average waiting time. [15] (Unit-II, Topic No. 2.4)
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.2
8.
Explain resource allocation graph algorithm for deadlock detection with relevant diagrams.
Enumerate the methods for handling a deadlock. (Unit-V, Topic No. 5.5)
(c)
Explain how to ensure the condition circular wait does not hold to prevent deadlock for occuring.
[15] (Unit-V, Topic No. 5.3)
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.3
(a)
Answer :
Answer :
(a)
Answer :
Answer :
Answer :
(a)
Answer :
Batch processing
2.
Multiprogramming
3.
Time sharing
4.
Real time
5.
Distributed.
1.
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.4
Ease of Use
Some users use Personal Computers (PC) for
performing general tasks such as word processing and emails.
A PC comprises CPU, monitor, keyboard and mouse. It can
be used by a single user at a time. The operating system in
PC is designed to allow ease in using the computers. Here,
there is no focus or very little performance parameters and
resource utilization.
Efficient Resource Utilization
Some users are connected to a mainframe or mini
computer through a terminal. Similar, other users can also
get connected to mini computer at the same time. This
connection is made by sharing resources and exchanging
information. The sharing of resources is done by operating
system ensuring efficient utilization of CPU timing, I/O
systems and memory for multiple users.
Individual Usability and Resource Utilization
Many users also use workstation connected in a
network. These workstation request for service from the
servers. In this client and servers environment the users of
a workstation have some exclusive resources as well as some
sharable resources such as printers and filer in the network.
Handled Computers
For answer refer Unit-I, Q11, Topic: Handheld and
Portable System.
Little or No User View
Few computers have very little or no user view. In
such operating system the interface is designed is such a
way that the computers is able to operate without the user
intervention.
Example
Embedded computers in parking garage.
2.
System View
The operating system is a resource manager
(allocator) and a control program from the system point of
view.
Resource Allocator
For answer refer Unit-I, Q1, Topic: Operating System
as a Resource Manager.
Control Program
For answer refer Unit-I, Q15, Topics: I/O Device
Support, File System Management, Error Detection,
Accounting, Protection and Security.
Q4. (a) Explain the following terms with their
definition with respect to a magnetic disk,
(i) Seek time
(ii) Latency
(iii) Bandwidth.
May/June-12, Set-1, Q4(a)
Answer :
(i)
Seek Time
For answer refer Unit-VII, Q8, Topic: Seek Time.
(ii)
Latency
For answer refer Unit-VII, Q8, Topic: Latency.
(iii)
Bandwidth
Answer :
RAID Level 2 and 3
Answer :
(a)
Answer :
Answer :
Answer :
(a)
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.5
Example
Critical section
M
Critical section
M
Signal (mutex)
3.
Signal (mutex)
Now, if the signal (mutex) is replaced by wait (mutex)
then, the code becomes,
Wait (mutex)
M
Critical section
M
Wait (mutex)
The execution of above code results in occurrence of
deadlock.
3.
Error Generated by Omitting the Execution of
Operation
This type of error occurs when execution of signal
(mutex) or wait (mutex) or both are omitted by the process.
Critical section
M
Answer :
Critical section
M
M
Critical section
wait (mutex)
The execution of above code results in simultaneous
execution of multiple processes in their critical section , there
by violating the mutual exclusion requirement.
2.
Error Generated by Interchanging the Execution
Order
This type of error occurs when the signal operation
defined on semaphore mutex is replaced by wait operation.
Example
Consider the following code
Wait (mutex)
Wait (mutex)
(a)
Answer :
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.6
Medium-term Scheduler
Medium-term scheduler reduces the degree of multiprogramming. This is done by temporary removal of some
processes from the memory. Which are reintroduced into the memory and their execution starts from the previous state
where they were taken out from the memory. This process of temporary removal and reassignment of the memory is quite
often seen in medium-term scheduler.
This scheduler utilizes the swapping mechanism is adopted in time sharing system.
Short-term(CPU) Scheduling
Short term scheduling chooser the processes which are ready to get executed and assigned to the CPU.
This schedules selects and submits a new process more frequently (in milliseconds).
(b)
Consider the following set of processes, assumed to have arrived at time 0, in the order
given with the length of the CPU burst time in milliseconds.
Process
Burst time
P1
10
P2
29
P3
P4
P5
12
Consider the FCFS and RR(quantum = 10 milliseconds) scheduling algorithms for this set of
processes, and schedule them. Find the average waiting time for each algorithm provide
Gnatt charts. Find which algorithm would give the minimum average waiting time.
May/June-12, Set-1, Q7(b)
Answer :
Given that,
Process
Burst time
P1
10
P2
29
P3
P4
P5
12
The order for process arrival is P1, P2, P3, P4 and P5 at time 0.
FCFS Scheduling Algorithm
The Gantt chart for the schedule (FCFS) is,
P1
0
P2
10
P3 P4
39 42
P5
49
61
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.7
0 + 10 + 39 + 42 + 61
5
152
5
P3
0
P4
P1
10
P5
20
P2
32
61
= 13
Round Robin (RR)
Given that time quantum is 10 millisecond
The Gantt chart for the schedule (RR) is,
P1
0
P2
10
P3
20
P4
23
P5
30
P2
40
P5
50
P2
52
61
= 23
Therefore, SJF scheduling algorithm would give the minimum average waiting time (i.e., 13).
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.
S.8
Q8.
Explain resource allocation graph algorithm for deadlock detection with relevant diagrams.
Answer :
Answer :
Methods for Handling a Deadlock
Deadlock Prevention
For answer refer Unit-V, Q7.
Deadlock Avoidance
For answer refer Unit-V, 12.
Post Deadlock Recovery
For answer refer Unit-V, Q19.
(c)
Explain how to ensure the condition circular wait does not hold to prevent deadlock for
occuring.
Answer :
WARNING : Xerox/Photocopying of this book is a CRIMINAL act. Anyone found guilty is LIABLE to face LEGAL proceedings.