• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | Gate IT 2005 | Question 41

Given below is a program which when executed spawns two concurrent processes : semaphore X : = 0 ; /* Process now forks into concurrent processes P1 & P2 */
P1 P2
repeat forever V (X) ; Compute ; P(X) ;  repeat forever P(X) ; Compute ; V(X) ;
Consider the following statements about processes P1 and P2:
  1. It is possible for process P1 to starve.
  2. It is possible for process P2 to starve.
Which of the following holds?  

(A)

Both I and II are true

(B)

I is true but II is false

(C)

II is true but I is false

(D)

Both I and II are false

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments