engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Operating Systems Concurrency and Synchronization Operating System Solution
Given below is a program which when executed spawns two concurrent processes:
Semaphore X: = 0;
/* Process now forks into concurrent processes P1 & P2 */
P1 : repeat forever P2 : repeat forever
V(X); P(X);
Compute; Compute;
P(X); V(X);
Consider the following statements about processes P1 and P2:
I: It is possible for process P1 to starve.
II: It is possible for process P2 to starve.
Which of the following holds?
1
Both I and II are true
2
I is true but II is false
3
II is true but I is false
4
Both I and II are false