Your task is to implement the First Readers Writers Problem using Java’s Semaphore Class. This class is described in the latest set of notes and will be/was discussed in class 3/29/16.
Reader’s / Writer’s Solution – NON-Java Version
SHARED DATA (you should be able to code all of this in Java!!!!)
Int readcount = writecount = 0;
SEM wmutex = rmutex = 1; // semaphores to gain mutual exclusion on counters
SEM wantin = 1; // writers waiting to get in
SEM writerswaiting = 0; // readers block here if writers are waiting