Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

CSC4320/6320 Quiz3

Name:_______________________
Question1:
Explain the following terminology:
1.
2.
3.
4.
5.

Race Condition (10%)


Critical section, Remainder section (15%)
Deadlock (10%)
Starvation (10%)
Monitor (15%)

Race Condition: several processes access and manipulate the same data
concurrently and the outcome of the execution depends on the particular order in
which the access takes place.
Consider a system with n processes, each of them has a segment code, called
critical section, in which the process may be changing common variables,
updating a table, writing a fileetc.
The section of code implementing this request is the entry section
The critical section maybe followed by an exit section
The remaining code is the remainder section
Deadlock two or more processes are waiting indefinitely (forever) for an event
that can be caused by only one of the waiting processes
Starvationindefinite (forever) blocking. A process may never be removed from
the semaphore queue in which it is suspended.
A high-level abstraction that provides a convenient and effective mechanism for
process synchronization. Only one process may be active within the monitor at a
time

Question2:
2.1 We consider a system consisting of two processes, P0 and P1, each accessing two
semaphores, S and Q, set to the value 1.
P0
Wait(S)
Wait(Q)

Signal(S)
Signal(Q)

P1
Wait(S)
Wait(Q)

Signal(Q)
Signal(S)

Does this have the chance to occur deadlock situation?(5%) Explain your answer? (15%)
NO

2.2 We consider a system consisting of two processes, P0 and P1, each accessing two
semaphores, S and Q, set to the value 1.
P0
Wait(S)
Wait(Q)

Signal(S)
Signal(Q)

P1
Wait(Q)
Wait(S)

Signal(Q)
Signal(S)

Does this have the chance to occur deadlock situation?(5%) Explain your answer? (15%)
YES

You might also like