$29.99
1) Implement the counting semaphores using binary semaphores. Pseudo-code for the implementation is given in the attached notes on Canvas: 10xcountingSemUsingBinarySem.pdf
Use the bounded-buffer producer-consumer problem as uploaded on Canvas (first code at https://jlmedina123.wordpress.com/2014/04/08/255/). Show the output of this code for BOTH the incorrect and correct implementations. Also, attach your codes (two versions: for incorrect and correct solutions) on Canvas. (10+10)
3) Consider the sample code for the reader-writer problem on Canvas. Change this code using counting semaphores to implement the scenario where the number of active readers is upper-bounded by N. Use the correct implementation of counting semaphores from (1) in this modified code. (20)
Deliverables: (i) 4 different code files (two from (1), one each from (2) and (3)), (ii) A report showing the outputs from each of the above 4 cases.
Late Policy:
5 points will be deducted for each day the assignment is late upto a maximum of 2 days (10 point deduction).