CS 422 - Operating Systems
Line Printer Queue Program
Write a line printer queue manager and a print queue submission program.
The queue manager will need to be kept running most the time and should
monitor the print queue for files to be printed. When a file appears, begin
printing it, until done, and then remove the entry from the queue. Print the
files to the console display of your system. Use a sleep call after each line
is printed to slow up the printing.
The submit command should add the directory path and file name of the
file to be printed to the print queue. It should then wake up the
print queue manager if necessary.
Use shared memory to hold the print queue. Make sure you test for
queue full upon submission and handle problems appropriately.
Include a cancel command that can be used by any user
to remove any entry from the queue. If the entry is
currently being printed, terminate the printing.
Write a program that will print the list of files in the
queue. Include an entry number to make it easier to specify
which entry to cancel.
Summary of Requirements
- A Print Queue Spooler program that monitors the print queue for
files to be printed. When a file appears (because it has been added) in the
queue, the spooler should print it out. Most of the time the spooler should
sleep and wake up periodically to check the queue for files to be printed.
- A Print command (program) that will submit a file name (and directory
path) into the print queue for printing. A nice improvement is for the
submit program to issue a wakeup signal to the spooler program so that
program can sleep for longer periods of time knowing that it will be woken
up if a file is submitted for printing.
- A List Print Queue command that will print the list of files in the print
queue being printed and waiting to be printed. The list should give any information
that will be necessary in specifying which entry is to be deleted or canceled.
- A Delete command that will delete an entry from the queue so that it
does not get printed. If the entry is in the process of being printed it should
be terminated.