RK21GTA01 - Assignment - Simulation Based - CSE316 - CSE316 CA2
RK21GTA01 - Assignment - Simulation Based - CSE316 - CSE316 CA2
OPERATING SYSTEM
CA3
SIMULATION-BASED
ASSIGNMENT
Logic:
Problem 1:
Problem 2:
We can use two semaphores - one for the students'
queue and one for the teachers' queue. Both of these
semaphores will be initialized to 1 initially. Whenever a
student or teacher enters the library, they will acquire
the corresponding semaphore and get added to the
queue. When the CPU is free, the process at the front of
the queue will be serviced.