Implementing a Work Queue The work queue is thread-safe so that multiple threads can simultaneously add and remove objects from it. class WorkQueue { LinkedList queue = new LinkedList(); public synchronized void addWork(Object o) { queue.addLast(o); notify(); } public synchronized Object getWork() throws InterruptedException { while (queue.size() == 0) { wait(); } return queue.removeFirst(); } }