incr(){
wait(s);
X = X + 1;
signal(s);
}
decr(){
wait(s);
X = X - 1;
signal(s);
}
To determine the minimum possible values of \(V_1\) and \(V_2\), we need to analyze the semaphore implementations and the operations between the threads calling the incr and decr functions.
incr and 3 threads calling decr, let's determine the net effect:
incr adds 1 to \(X\), resulting in \(5 \times 1 = 5\).decr subtracts 1 from \(X\), resulting in \(-3 \times 1 = -3\).incr and decr execution could happen concurrently:
Therefore, the minimum possible values of \(V_1\) and \(V_2\) are 12 and 8, respectively. Hence the correct answer is 12, 8.