I dont understand the problem with mutex. When the 1st process executes and count is 0, then context switching happens and items are added, it will again come to the 1st process, now since reg value is still points to 0, i should go to sleep(full); instruction. But why is it waiting?
will the mutex problem get solved if we replace the following statements - "if(count == 1)" with "if(count >=1)" in producer. "if(count == N-1)" with "if(count
when does the consumer load zero into the 'count', it is global right? so by the time it has a context switch back from producer the value of count should be 1
The mutexes full and empty are incorrectly placed. Consumer should block on empty and producer should block on full. This will still work properly but the mutexes could be named better.
NPTEL videos are amazing. I needed a deep understanding of OS and was having hard time finding the right resources but this definitely helped.
I dont understand the problem with mutex. When the 1st process executes and count is 0, then context switching happens and items are added, it will again come to the 1st process, now since reg value is still points to 0, i should go to sleep(full); instruction. But why is it waiting?
will the mutex problem get solved if we replace the following statements -
"if(count == 1)" with "if(count >=1)" in producer.
"if(count == N-1)" with "if(count
when does the consumer load zero into the 'count', it is global right? so by the time it has a context switch back from producer the value of count should be 1
In producer-consumer problem code,Why did he declare 2 mutexes empty n full instead it can be done by one mutex only.
What is difference between remove the item and consume the item 6:08
essentially
The mutexes full and empty are incorrectly placed. Consumer should block on empty and producer should block on full. This will still work properly but the mutexes could be named better.
had me confused
Indeed, I confused me. But, I wonder what do we need count for ?
Could you upload your powerpoint please?