Consider the Producer-Consumer problem with a shared buffer of size $N=5$. The system uses three semaphores$: \verb|empty|$ $($initialized to $5 )$, $\verb|full|$ $($initialized to $0 )$, and $\verb|mutex|$ $($initialized to $1)$.
The Producer process executes the following code:
while(true) {
// Produce item
Wait(empty);
Wait(mutex);
// Add to buffer
Signal(mutex);
Signal(full);
}The Consumer process executes the following code:
while(true) {
Wait(full);
Wait(mutex);
// Remove from buffer
Signal(mutex);
Signal(empty);
// Consume item
}Suppose the Producer has already added $\mathbf{3}$ items to the buffer. If $\mathbf{2}$ Consumer instances and $\mathbf{1}$ Producer instance now attempt to access the buffer simultaneously, what is the maximum possible value the semaphore $\verb|empty|$ can reach during their execution?