You are on page 1of 2

Assignment: Multi-Threading

This is a team project. Each group should submit one copy to Blackboard. The submission should include
the following:

1. The role and achievement of each member in the group.


2. Source codes of the project in a compressed file.
3. Project documentations (project structure, major data structure, thread structure, synchronization
structure, etc.)
4. Test results
5. Screenshots of the project.

Project requirements

Write a program in whatever programming language you would like to use to simulate the customer-teller
problem shown in the following figure.

Counter 1
Scheduler
Customer Teller 1

Counter 2

Teller 2
... ...

Counter n

Teller n

• Write a thread to put customer into the waiting queue. The number of customers in the queue
cannot be more than 20. If the queue is full, no more customer is allowed to enter the queue and
the thread generating customers has to wait. You can decide the generating speed of customers.
• The scheduler thread pick up customer in the queue and send customer to a counter that is empty.
If there is no empty counter, the scheduler will wait.
• One counter can have at most one customer and one teller can serve at most one customer. You
can decide the mean service time for each customer. However, the service time for each customer
should be a random number.
• Generate proper messages when something happen, e.g., a customer enters the queue, a customer
leaves the system, etc.
• Documents for the design and test results. Analyze why you can get the results and if the
deadlock will happen in your solution.

You might also like