Q36
MSQ2 marksConsider a multi-threaded program with two threads and . The threads share two semaphores: (initialized to ) and (initialized to ). The threads also share a global variable (initialized to ). The threads execute the code shown below. //code of T 1 wait (s1); x = x+1; print (x); wait (s2); signal(s1); // code of T2 wait (s1); x= x+1; print (x) ; signal (s2); signal (s1); Which of the following outcomes is/are possible when threads and execute concurrently?
Sign in to save attempts.
Loading…