This project includes the FSP design and Java multi threaded implementation for a shared printer used by 2 students and 1 technitian.
- Printer process
- Initialize with 3 papers
- Should have atleast 1 paper to proceed printing
- Users must have mutually exclusive access to the printer
- Paper count is decremented in each print
- Student Process
- Initialize with number of documets to print (1 document = 1 paper)
- Must take mutually exclusive access to printer to print
- Print document and decrement document count
- Release control of the printer
- Technician Process
- Repeatedly check if the printer is out of papers
- When printer is out of papers, fill it with maximum number of papers
Then the composite process will be,
- One student process that is to print 3 documents.
- One student process that is to print 2 documents
- One technician process that refills the printer with 3 sheets of paper.
- One printer process that can hold up to 3 sheets of paper.
In addition to the above mechanism, The java implementation of the scenario will add another user who is a technician who re-fills the toner of the printer.