Programming assignment
$30-60 USD
Paid on delivery
Programming assignment using C and Java. 3 questions. Programming Part 1. The program given uses the pthread mutexes to protect shared variables from concurrent access. Comment out all the calls to pthread_mutex to check if a race condition occurs in the absence of synchronization primitives. Explain what happens in the absence of synchronization primitives and why? Include 5 test runs. 2. Pthread mutexes can be considered binary semaphores. It is possible to implement a general counting semaphore using mutexes. Implement a counting semaphore using mutexes then use your counting semaphore to implement a solution for the producer ??" consumer problem with one producer and one consumer. The producer and the consumer must sleep for a random period after producing or consuming an item. Run the program using a buffer size of 10 and stop when 25 items have been produced and consumed. Make sure that both threads display enough information for verifying the program. Include 5 test runs. 3. Java supports several synchronization mechanisms including a mutex-like mechanism called lockObject. Use lockObjects to implement the dining philosophers problem.
## Deliverables
1) Complete and fully-functional working program(s) as well as complete source code of all work done. 2) Complete ownership and distribution copyrights to all work purchased.
## Platform
C, Java
Project ID: #2916107