jeudi 16 septembre 2021

design a multi-threaded communication

I got an assignment on java multithreading from my university and I have some questions regarding the implementation.

I have 3 types of threads, security guard, manager, and customer.

flow:

  1. The customer enters the security guard's queue
  2. The security guard checks in his list if the customer is allowed to continue.
  3. if not, the security guard needs to send the customer to the manager list.
  4. the manager can add the customer to the security guard's list and send him back to his queue.

questions which I am not sure about:

  1. How can the security guard send a customer to the manager's queue?
  2. The manager doesn't hold the security guard's list but he may add a customer to the list, so how should he get the list?

Aucun commentaire:

Enregistrer un commentaire