Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Write a solution for the bounded-Buffer producer consumer problem, Considerin

ID: 3586252 • Letter: 1

Question

1) Write a solution for the bounded-Buffer producer consumer problem, Considering: one producer, one consumer and one buffer. You must declare the number of semaphores used in you solution and indicate their initial values.

2) Write a solution for Bounded-Buffer producer-consumer problem, considering: one producer, one consumer and two buffers. You must declare the number of semaphores used in your solution and what are initial values. The producer inserts the same value in both buffers. The consumer consume both buffers. Buffer 1 is size 5 and buffer 5 is size 7.

Explanation / Answer

1)In the following example there are three semaphores. Full, used for counting the number of slots that are full; empty, used for counting the number of slots that are empty; and mutex, used to enforce mutual exclusion.