Question: QUESTIONS a) Regarding the Producer-Consumer problem, state the function: [2 marks] Producer process ii. Consumer process iii. Unbounded- buffer iv. Bounded buffer c) The buffer

 QUESTIONS a) Regarding the Producer-Consumer problem, state the function: [2 marks]
Producer process ii. Consumer process iii. Unbounded- buffer iv. Bounded buffer c)

QUESTIONS a) Regarding the Producer-Consumer problem, state the function: [2 marks] Producer process ii. Consumer process iii. Unbounded- buffer iv. Bounded buffer c) The buffer can be in three states. Draw the buffer states. [2 Marks] a) Peterson's Algorithm: Given a code for Process O and Process 1 in Table 4. Fill in flags and turn variables if Process 1 initiates the request to enter the critical section. [3 Marks) Table 4 do i 0) Process o Process 1 do flag|0] = TRUE; flag|11 - TRUE; turn-1: turn 0; while (flag|1] && turn-1) while (flag|0] && turn : / do nothing * : * do nothing critical section critical section flag0 - FALSE; fagl11 - FALSE; remainder section remainder section while (TRUE): while (TRUE): Table 5 flag|0 flag|11 Turn Events FALSE TRUE 0 1 ---- P request to enter CS Penters CS P requests to enter CS P executes RS Penters CS Pexecutes RS P executes RS P, executes RS P requests to enter CS c) Justify your answer by showing: Mutual exclusion is preserved [1 marks] a) The Progress requirement is satisfied [1 marks] in. The bounded-waiting requirement is met [1 marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!