File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Manager / worker / updated data

 
John Vorwald
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to learn / understand concurrency threads.
I expect to have a GUI start a SwingWorker, and the SwingWorker manages a number of worker threads, and some data is updated periodically.
I would like the manager to start the workers, then have data appear, then have the data updated after a period.
When the data is updated, I would like to have the workers utilize the new data in a controlled manner.
Also, the manager should be able to interrupt the worker threads.
The following code has minimal synchronization, and I'm not sure it's in the correct places. How should the code be modified so that the workers are notified that the data is being updated, and also so that the workers transition to the new data in a controlled manner.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic