I want to set up a queue that can feed into 3 seperate threads. Each thread is pretty much identical. For example each thread will run for say 1 minute. When an entity 'enters' the thread no other entity can enter for 10 seconds(Im just making numbers up... so I want it to be generic).
I know to use synchronize, wait, and notify, but Im struggling with the design.
I have a controller class that contains my queue of entities. It then has to place the entities in the proper thread.
How do I do the delay? I understand the consumer producer, but this has two more requirements.
1. There is a delay before an item can be consumed. 2. After it is consumed, it has to move to another timer.
class myThread extends thread{ mythread(){} synchronized start()( starts a timer that lasts 10 seconds. notify() } continue(){ lasts 50 seconds sets boolean flag when complete }