retagged by
529 views
0 votes
0 votes

I know, that both P and C can go and fall into sleeping state in case of preemption and this can be solved via Semaphores.

 

Now, my doubt is that integer bit that will be set by the P and being sent to C and C will see the semaphore bit = 1 and won't go to sleep and whenever C finally goes to sleep will decrement the bit, but is it also the case that when P is sleeping then C can also send a semaphore bit = 1 for P and when Producer sees that bit = 1 and start producing and when buffer is full, P will decrement that bit and go to sleep?

Basically, both P and C can send this integer bit or only P can send this to C to wake him up?

 

Thank you!

retagged by

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
4
ajayraho asked Oct 23, 2022
910 views
What is the significance of infinite loop that is written in every example of process synchronisation? What would happen if there wasn't any infinite loop?