Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Threads and Synchronization and the fly likes Producer/Consumer using SwingWorker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Producer/Consumer using SwingWorker " Watch "Producer/Consumer using SwingWorker " New topic

Producer/Consumer using SwingWorker

Benoit Aumars

Joined: Aug 15, 2001
Posts: 2
Hi all,
Questions about Thread.
Does anybody can help me regarding Producer/Consumer using SwingWorker ?
Here is the background.
I'm developing a Java program, Swing based, which :
a). check every, say, 30 sec if a file within a directory exists
b). if exists, the process it ( this could be time-consuming task ).
c). run a query every, say, 60 sec ( this could be time-consuming task
d). process the result set ( this could be time-consuming task ).
Given that scenario, I think the concept of Producer/Consumer fit.
The Producers are a) and c), and the Consumers are b) and d).
My problem is how implement the SwingWorker for Producer/Consumer ?
Or is there any other approach ( with a sample code ) ?
Any comments would be appreciated.
I agree. Here's the link:
subject: Producer/Consumer using SwingWorker