Multi-thread synchronization using semaphores
$10-30 USD
S-au achitat serviciile după ce au fost prestate
Implement the solution for the following synchronization problems:
No-starve readers-writers solution (5 readers, 5 writers)
Writer-priority readers-writers solution (5 readers, 5 writers)
Dining philosophers solution #1
Dining philosopher’s solution #2
This is essentially a direct implementation of the solutions from Downey's book.
Download the starter code that solves the producer-consumer:
The starter code has an implementation of a simple Semaphore class.
You can adapt this code to complete it.
Name the compiled program cs_sync.
Your program should be executed by calling it from the command line as follows:
> cs_sync <problem #>
For example, to run the solution of problem 2, you will call:
> cs_sync 2
To demonstrate that your program works, you will print messages indicating what the threads are doing (e.g., "Reader 1: reading", "Philosopher 1: Thinking").
ID Proiect: #19131709