Computer Sciences > Gate 2024 Set-2 > Thread
Consider a multi-threaded program with two threads T1 and T2. The threads share
two semaphores: s1 (initialized to 1) and s2 (initialized to 0). The threads also
share a global variable x (initialized to 0). The threads execute the code shown
below.
Which of the following outcomes is/are possible when threads T1 and T2 execute
concurrently?

Correct : a
Similar Questions
Consider the following expression: π₯[π]=(π+π)ββπ [π]+π’/π€. The following
sequence shows the list of triples representing the given expression, with entries
mi...
Consider the following expression: π₯[π]=(π+π)ββπ [π]+π’/π€. The following
sequence shows the list of triples representing the given expression, with entries
mi...
Consider the following expression: π₯[π]=(π+π)ββπ [π]+π’/π€. The following
sequence shows the list of triples representing the given expression, with entries
mi...
Total Unique Visitors
Loading......