title: What threads are allowed to call SwingWorker#publish?
body: <p>Standard scenario: User presses button and starts big task. EventThread creates <code>SwingWorker</code> to execute the task and get's on with life.</p>
  
  <p>Now, since the big task is highly parallelizable, the first thing the <code>SwingWorker</code> thread does is to create a bunch of worker threads and farms the work out.</p>
  
  <p>My question: Are the worker threads allowed to call <code>SwingWorker#publish()</code> to trigger a <code>GUI</code> update or is only the <code>SwingWorker</code> thread allowed to do so?</p>
  
  <p>Thanks,
  Carsten</p>
  
  <p>[Edit] Some pseudo code to make my use-case a bit clearer. The quesiton is basically: Is the code below OK? And what if I leave out <code>waitForAllWorkerThreadsToFinish();</code>?</p>
  
  <pre><code>public class MySwingWorker extends SwingWorker {
  
    class MyWorkerThread extends Runnable {
      void run() {
        while(!exitCondition) {
          doSomeWork();
          publish(progressUpdate);
          reEvaluateExitCondition();
        }
      }
    }
  
    public Void doInBackground() {
      createAndStartBunchOfMyWorkerThreads();
      waitForAllWorkerThreadsToFinish();
    }
  
    void process(List&lt;V&gt; chunks) {
      updateGuiWithProgress(chunks);
    }
  }
  </code></pre>