SP2023 Midterm 1
A simple batch OS may be described as a set of three processes interacting as follows: You must use P() and V() function.
Process BATCH OS
semaphore in=out=1, card=line=0, fcard=fline=1;
process reader:
begin
while(1)
read record from input device;
deposit record in input buffer
end;
process main;
begin
while(1)
fetch record from input buffer;
process record and generate output line;
deposit line in output buffer
end;
process printer;
begin
while (1)
fetch line from output buffer;
print line on output device
end
in the blanks if you need using semaphore operations to properly buffer the input as flows from the reader to the main function, the output data that flows from main to printer.