aspose file tools
The moose likes Java in General and the fly likes Producer-Consumer (BlockingQueue) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Producer-Consumer (BlockingQueue)" Watch "Producer-Consumer (BlockingQueue)" New topic
Author

Producer-Consumer (BlockingQueue)

Stefan Gerber
Ranch Hand

Joined: Mar 08, 2008
Posts: 33
Hello,
I have a Producer that puts some job on a blockingQueue. The Consumer (WorkerThread) takes this jobs and process it. I have a second list (Vector) where i store all OpenJobs. now the producer should wait till all jobs are finished (The openJobs list is empty). Is there something like a blockingQueue that blocks the producer Thread till the last elemet is removed from the openjobs list? Or is there a design pattern that covers this topic?

thanks
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Producer-Consumer (BlockingQueue)
 
Similar Threads
want to start new thread when another thread is sleeping
Runtime error
Semaphores in Java
Producer Consumer Controller
producer consumer thread with implementation of concurrent linked queue