Consider a process with three threads A, B, and C. The default thread of the process receives multiple requests, and places them in a request queue that is accessible by all the three threads A, B, and C. For each request, we require that the request must first be processed by thread A, then B, then C, then B again, and finally by A before it can be removed and discarded from the queue. Thread A must read the next request from the queue only after it is finished with all the above steps of the previous one.
sem a1done = 0; b1done = 0; cdone = 0; b2done = 0;
get request from queue and process
finish with request
All thread is running in forever loop.
Which of the following is correct?
A. The proposed solution prevents deadlock but fails to guarantee mutual exclusion
B.The proposed solution guarantees mutual exclusion but fails to prevent deadlock
C.The proposed solution guarantees mutual exclusion and prevents deadlock