365 views
3 3 votes

Consider a NON-NEGATIVE COUNTING SEMAPHORE $S$. The operation $P(S)$ (wait) attempts to decrement $S$, and the operation $V(S)$ (signal) increments $S$. A process executing a $P(S)$ operation will BLOCK if the current value of $S$ is $0$ .

During a specific execution sequence, $\mathbf{35}$ $P(S)$ OPERATIONS and $\mathbf{18}$ $V(S)$ OPERATIONS are issued in an arbitrary order. What is the LARGEST INITIAL VALUE of $S$ for which at least THREE $P(S)$ operations will remain blocked at the end of the sequence?

  1. $13$
     
  2. $14$
     
  3. $15$
     
  4. $16$

2 Answers

0 0 votes
Total $P(S)$ issued $=35$.

Total $V(S)$ issued $=18$.

Let $I$ be the initial value of the semaphore.

Total potential successful $P(S)$ operations $=I+18$.

Number Blocked $=$ Total $P(S)-($ Initial $S+$ Total $V(S))$

$3 \leq 35-(I+18)$

$I \leq 14$
Answer:
Position:
Show:

Related questions

5 5 votes
3 3 answers
412
412 views
GO Classes asked Jan 2
412 views
Consider a computer system with $\mathbf{2 5 6 ~ M B}$ of PHYSICAL MEMORY and a $\mathbf{40-}$bit VIRTUAL ADDRESS SPACE. The system utilizes a paging scheme where the PAG...
1 1 vote
2 2 answers
368
368 views
GO Classes asked Jan 2
368 views
A system consists of four active processes $P=\left\{P_1, P_2, P_3, P_4\right\}$ and four distinct singleinstance resource types $R=\left\{R_1, R_2, R_3, R_4\right\}$. Th...
3 3 votes
2 2 answers
308
308 views
GO Classes asked Jan 2
308 views
A system manages $\mathbf{12}$ IDENTICAL PRINTING UNITS. There are three processes $(P_1, P_2, P_3)$ currently utilizing these units. The current state of the system is d...
3 3 votes
3 3 answers
420
420 views
GO Classes asked Jan 2
420 views
A computer system contains $\mathbf{10}$ IDENTICAL MAGNETIC TAPE DRIVES. There are $N$ processes currently running in the system, and each process has a MAXIMUM NEED of $...