Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Let\'s assume threads are schedule din the order P1, P2, P3, P4, C1, where Pn ar

ID: 660937 • Letter: L

Question

Let's assume threads are schedule din the order P1, P2, P3, P4, C1, where Pn are Producer Threads and Cn are Consumer Threads. Suppose P1 was scheduled and was able to obtain the lock to enter the critical section, but the queue was full. Please specify the state of P1, P2, P3, P4 right before C1 notifies all the Producers about available space. Also, specify their states right after C1 notifies them. Fill in the table with the correct choices.

Choices Available:

a. new thread (right before thread.start() is called)

b. running on CPU

c. ready to run

d. blocked, waiting for the lock

e. blocked, waiting for queue

1. Right before C1

2. Right after C1

P1 P2 P3 P4

Explanation / Answer

1. Right before C1

2. Right after C1

P1 P2 P3 P4 Ready to run Blocked, waiting for lock Blocked, waiting for queue Blocked,waiting for queue