Question: Implement the bounded buffer problem (also known as the producer-consumer problem) satisfying the following conditions: 1) We can have only one producer process and only

Implement the bounded buffer problem (also known as the producer-consumer problem) satisfying the following conditions: 1) We can have only one producer process and only one consumer process. 2) buffer[] can store up to N items. 3) Use a semaphore named 'mutex' for exclusive access to the buffer and some other shared variables. 4) Use an integer variable named 'count' to resent how many items are stored in the buffer. 5) In addition to 'mutex', you can use only one more semaphore, but cannot use any h/w instruction or a monitor. 6) Busy waiting is not allowed for each process in any case. 7) An integer variable named 'in' is a pointer referencing the next buffer element to be used by the producer process, and an integer variable named 'out' is a pointer referencing the next buffer element to be used by the consumer process. 8) A Boolean variable named 'process_blocked' is used to indicate whether a process is blocked or not (due to its synchronization requirement)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
