[concurrency-interest] SwingWorker a special producer/consumer

Rémi Forax forax at univ-mlv.fr
Thu Jun 1 04:51:55 EDT 2006


Yesterday, i found a bug in the Sun implementation of the SwingWorker :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6432565

Basically a swing worker permits to create a worker thread for
a long duration job that need to perform some refresh of the
swing ui without freezing the application.

Because only the Event Dispatch Thread can change the
swing UI, the worker thread publish data and
the EDT consume them.
see http://download.java.net/jdk6/docs/api/javax/swing/SwingWorker.html

It's a special producer/consumer because the EDT consume
all the available data in once.

Which data structure should be used in that case ?

Rémi Forax






More information about the Concurrency-interest mailing list