Task: Create a multi-threaded application that works correctly with shared resources and avoids deadlock situations. Any entity desiring to access a shared resource must be a thread. Use java.util.concurrent and java.util.concurrent.locks. Subject: CallCenter. There are several operators. The operator can serve simultaneously one client. In the absence of free operators, CallCenter puts calls in a queue. The customer, standing in line, can hang up and call again after some time. Implement in java.
I singled out the Client, Operator, and CallCenter classes. It is clear that there should be a queue of customers, a queue of operators, and CallCenter should serve them. It is not very clear how to arrange everything.
Question: which of these classes should be streams, which queue is better to use in my case?
dummy[42]arraydummy[42]easily summarized into a pattern and will soon become a trend :) - Shamov