51.2k views
3 votes
A. List and define the 3 control problems associated with competing processes.

b. List the requirements for mutual exclusion.
c. How is a semaphore different from a monitor.
d. What 3 conditions must be present for deadlock to be possible? How can each be prevented? What is the 4th condition that creates deadlock?

User SaRiD
by
6.9k points

1 Answer

5 votes

Answer:

A) The 3 control problems associated with competing processes are:

(a) Mutual Exclusion

(b) Deadlock

(c) Starvation

B) Requirements for Mutual Exclusion

A process that is halting should do so without interfering with other processes

No Deadlock or Starvation

A process should not be denied access to a critical section when there is no other process using it

A process must remain inside its critical section for a finite time only

C) Difference between Semaphore and Monitor

Semaphore is an integer value used for signaling among processes

Monitor is a programming language construct that encapsulates variables, access procedures, and initialization code within an abstract data type

Only 3 operations is performed on Semaphore, all of which are atomic: initialize, decrement and increment

Only 1 operation may be actively accessed via its access procedures

D) Three conditions that must be present for deadlock to be possible:

Mutual Exclusion

Hold and Wait or Partial Allocation

No pre-emption

Resource Waiting or Circular Wait

By ensuring that at least one of the above conditions cannot hold, we can prevent the occurrence of a deadlock.

Step-by-step explanation:

User Mark McKim
by
5.9k points