Question: 2. (6 points) In the following code, three processes are synchronized using two semaphores L and R and produce output using the routine putc semaphore

2. (6 points) In the following code, three processes are synchronized using two semaphores L and R and produce output using the routine putc semaphore L.value = 3, R.value = 0; /* initialization */ /Process 1 L1 : /Process 2 L2 : /Process 3 L3: wait (L) putc('C signal (R) wait (R) putc 'A'; putc('B' signal (R) goto L2; wait (R) putc'D' goto L3; goto Ll; (a) How many D's are printed when these processes run? (b) Is CABABDDCABCABD a possible output sequence when these processes run? (c) Is CABACDBCABDD a possible output sequence when these processes run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
