[SOLVED] CMSC312 Assignment 2

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon assignment2-ozwubi.zip (249.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

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).

  • assignment2-ozwubi.zip