Question: a) How many A and Bs are printed when this set of processes runs? b) What is the smallest number of Ds that might be

a) How many A and Bs are printed when this set of processes runs?
b) What is the smallest number of Ds that might be printed when this set of processes runs?
c) Is AEBCBCDAA a possible output sequence when this set of processes runs? Clarify your answer.
Question 1. [25 pts] In the following code, four processes produce output using the routine "printf" and synchronize using three semaphores "R", "S" and "T." We assume function 'printf' wont cause context switch. Semaphore R-1, S-3,T-0; /* initialization */ process1* P(S) printf('A); process 2 * P(T); printf (B) printf ('C) /process 3*/*process 4 */ while(true){ while(true) { while(true){ while(true){ P(T); P(R); printf(D), V(R); printf (E); V(T); V(T)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
