In: Computer Science
4.1)
What three conditions must be satisfied in order to solve the critical section problem and why?
4.2)
Please answer each of the following questions briefly:
a) What is deadlock avoidance? (2 points)
b) What is deadlock prevention? (2 points)
c) Please discuss a strategy for deadlock avoidance (3 points)
d) Please discuss a strategy for deadlock prevention (3 points)
5. (Chapter 6) Please answer the following questions briefly (5 points each, total 10 points)
5.1)
Explain the process of starvation and how aging can be used to prevent it.
5.2)
What effect does the size of the time quantum have on the performance of an RR algorithm?
Refer to Operating System Concepts Essentials, 2nd Edition
4.1)The three conditions that are satisfied in order to solve critical section problem are:
)Mutual
Exclusion:if one process executes in critical section, no other
process are allowed to execute in the critical
section.
)Progress:if
no process is executing in the critical section and the other
processes are waiting outside the critical section in order to
enter the critical section ,then only those processes that are not
execute the remainder critical section can participate that will
enter the next.
)Bounded
Waiting:it implies that there exists a bound on the number of times
a process is taken to enter the critical section there
after the process has made any request to enter the critical
section and before the request is granted.
In order to synchronize the cooperative processes,we must do solving of critical section.we must solve the critical section problem in such a way by giving solution which satisfies the above three requirements.These are the three major requirements for synchronization mechanisms.
4.2)
In Operating Systems,Deadlock is a process or a situation in where a set of processes are blocked because each process is holding a resource and it is waiting for another resource acquired by the other processes.
a)Deadlock avoidance:
It
is a process of avoiding deadlock,and it does not totally prevent
deadlock.
It
ensures that system does not go in unsafe state.
In
this Resource requests are done according to the available safe
path.
It
requires the entire information about the existing resources,the
available resources,and the resource requests.
In
this,request checks are automatically considered and it will check
whether it is safe for the system or not.
b)Deadlock prevention:
It
blocks at least one of the conditions which are necessary for the
occurrence of deadlock.
In
this all the resources are requested together.
It
does not require any information about the existing resource,the
available resources,and the resource requests.
It
prevents deadlock by constraining request of resource and handling
of resources.
c)Deadlock avoidance strategy:
Must
specify a maximum claim.
By
knowing all future requests and releasing all the requests is a
difficult process.
By
estimating maximum demand for resources of each process is a easier
procedure to produce.
In
distributed Real Time Embedded Systems ,Deadlock
occurs.
Thus
a occurrence of deadlock avoidance also happens.
d)Deadlock prevention strategy:
For
service oriented transaction processing an efficient deadlock
prevention is needed.
The
reliability of business applications can be guaranteed by
transaction processing.
In
distribution management,locking resources are widely used to keep
the system consistent.
It
results in various deadlocks.
It
will leads to deadlock prevention also.
5)
5.1)Starvation:
In
operating system,like deadlock another problem also occurs. It is
STARVATION.
It
is a problem that occur in high priority processes which keep
executing and low priority processes keeps blocked.
In
this,resources are continuously utilized by high priority
processes.
The
priorities are assigned to the processes.
Starvation
can be prevented by Aging.
Prevention of starvation by Aging:
Aging
is a scheduling technique for preventing starvation.
In
this,the gradually increasing of the priority processes that wait
in the system for a long time.
In
Aging,after some fixed amount of time quantum,the increasing of
priority of low priority processes occurs.
By
doing aging,as time passes,the lower priority process becomes
higher priority process.
Thus
we can allocate CPU for it.
5.2)Effect of size of the time quantum on performance of RR algorithm:
The
scheduling of the process is one of the most important tasks on
operating system.
Round
Robin (RR) algorithm is one of the scheduling algorithm used by
most of the operating systems.
In
this,the ready processes are waiting in the ready queue,which seize
the processor for a short period of time ,which is called as TIME
QUANTUM.
If
the time quantum is extremely large,The policy of the ROUND ROBIN
(RR) algorithm is same as the policy of FIRST COME FIRST SERVE
(FCFS) algorithm.
If
the time quantum is extremely small,the approach behind RR
algorithm which is called as process sharing,that leads in creating
the appearance of each n processor which has its own processor
running at 1/n time the speed
of real time processor.