avinash-coder / Service-counter

Service counter with two service personnel on a queue of customers for demonstration of concurrency control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Service-counter

There is a service counter which has a limited waiting queue outside it.
It works as follows:
i)The counter remains open till the waiting queue is not empty
ii)If the queue is already full, the new customer simply leaves
iii)If the queue becomes empty, the outlet doors will be closed (service personel sleep)
iv)Whenever a customer arrives at the closed outlet, he/she needs to wake the person at the counter with a wake-up call

Implemented the above-described problem using semaphores or mutuexes along with threads. Also shown how it works, if there are 2 service personel, and a single queue.
Tried to simulate all possible events that can take place, in the above scenario.

About

Service counter with two service personnel on a queue of customers for demonstration of concurrency control.


Languages

Language:Java 100.0%