Spring 2024 - CS604P - 2
Spring 2024 - CS604P - 2
Please carefully read the following instructions before attempting the assignment.
You should consult the recommended books to clarify your concepts, as handouts are insufficient.
Assignment Submission:
You are supposed to submit your assignment in Doc or Docx format.
Any other formats, such as scanned images, PDF, zip, rar, ppt, and BMP, will not be accepted.
You are required to send the asnwer of Question No. 1 in the same Word file.
OBJECTIVE
The objective of this assignment is to provide hands-on experience in the:
To introduce the critical-section problem, whose solutions can be used to ensure the
consistency of shared data. To present both software and hardware solutions of the
critical-section problem.
NOTE
No assignment will be accepted after the due date via email in any case (whether it is due to load
shedding or internet malfunctioning, etc.). Hence, refrain from uploading assignments within the
last hour of the deadline. It is recommended that the solution file be uploaded at least two days
before its closing date.
Please consult your instructor before the deadline if you find any mistake or confusion in the
assignment (Question statement). After the deadline, no queries will be entertained in this
regard.
You are required to find out mistakes in the following pseudo code. Make correction in
pseducode and explain working of this puesudo code.
Pseudocode Example:
printer_queue = Queue()
printer_lock = Lock()
def printer_daemon():
while True:
if not printer_queue.empty():
printer_lock.acquire()
job = printer_queue.get()
print(f"Printing job: {job}")
time.sleep(2)
print(f"Completed job: {job}")
printer_lock.release()
employees = [
(1, 'Report_A'),
(3, 'Report_C')
]