Question: Consider the following multi - threaded C pseudocode:lock ( &mutexA ) ;cond _ signal ( &cv ) ; } void insertQueueB ( void * data

Consider the following multi-threaded C pseudocode:lock(&mutexA);cond_signal(&cv);}
void insertQueueB(void* data){
lock(&mutexB);
pushQueue(&queueB, data);unlock(&mutexB);
}
void* getDataFromQueueAOrQueueB(){lock(&mutexC); lock(&mutexA); data = popQueue(&queueA); break; unlock(&mutexA); if (!isEmpty(&queueB)){ unlock(&mutexB); } cond_wait(&cv, &mutexC);unlock(&mutexC);}Select the best steps for exposing the race condition in this code.
Step 1:
Step 2:
Step 3:
The choices for each Select are
Thread Z executes lines 2-5
Thread X executes lines 8-11
Thread Y executes lines 14-23
Thread Y executes lines 24-31
They can be chosen more than once.
 Consider the following multi-threaded C pseudocode:lock(&mutexA);cond_signal(&cv);} void insertQueueB(void* data){ lock(&mutexB); pushQueue(&queueB,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!