Skip to content

Demonstrate the mechanism of a Java monitor by a shared printer

Notifications You must be signed in to change notification settings

Warsha97/SharedPrinter

Repository files navigation

SharedPrinter

Demonstrate the mechanism of a Java monitor by a shared printer

This project includes the FSP design and Java multi threaded implementation for a shared printer used by 2 students and 1 technitian.

FSP There are 3 induvidual processes.
  1. 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
  2. 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
  3. 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.

About

Demonstrate the mechanism of a Java monitor by a shared printer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages