you will implement the following synchronization problems:
Serialization of 3 threads
Rendezvous of two threads
Producer-consumer with 3 producers and 4 consumers (limited-size buffer).
Readers-writers problem with 5 readers and 2 writers. Here, implement the solution with a turnstile semaphore to avoid the starvation of writers.
You should test your programs to ensure they build and work properly. Notice that posix semaphores do not work on Mac OS X. Please, use the linux distribution that I asked you to install at the start of the course (ubuntu). This is the OS that I will use to test your programs.
I added an example program (see attached) that uses a semaphore wrapper class, and serializes two threads. I think this class makes coding easier as you just need to initialize the semaphores and use the function wait and signal that are part of the Semaphore class. The class implementation can be found in the file semaphore_class.h. My example is in the program serialization.cpp. To build the example program use:
g++ [url removed, login to view] -lpthread -o serial -lm
Please, submit just source code (no binaries) with a makefile that builds the programs
Due in 2 days
Pleeeeeease if you are not ready to discuss the project, please don't bid !! I got a lot of biding on the last one and non of the bidder was able to communicate with me