Question: true or false Given the following pseudo code: sem_t mySem = 4; // initialize the semaphore value to 4 void detractor() { |} int i;

true or false
Given the following pseudo code: sem_t mySem = 4; // initialize the semaphore value to 4 void detractor() { |} int i; for (i = 0; i < 8; i++) { sem_wait(mySem); } void supporter() { } int j; for (j = 0; j < 5; j++) { sem_post(mySem); } Assume that you have two threads: to running detractor() and t1 running supporter(). Both of these threads run simultaneously. The main thread is also joined with these two threads. Answer the following true/false question. In this scenario (mySem is initialized to 4), it is possible for to to block on mySem.
Step by Step Solution
3.54 Rating (157 Votes )
There are 3 Steps involved in it
The detailed answer for the above question is provided below True The d... View full answer
Get step-by-step solutions from verified subject matter experts
