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.