That makes a lot of sense about why this is so frustrating.  Thanks to your advice, I am able to make use of invokeLater to at least display dialogs to the user and then run processes on the event dispatch thread.  In addition I&#39;m trying to work with SwingWorker&#39;s doInBackground and done methods to move VTK operations that are not yet attached to the UI into a different thread, and then attach them to the UI in the done() method.  <div>
<br></div><div>Thanks again for your help</div><div><br></div><div>PS, I have two outstanding questions that I really would like some help with</div><div><a href="http://permalink.gmane.org/gmane.comp.lib.vtk.user/52639">http://permalink.gmane.org/gmane.comp.lib.vtk.user/52639</a></div>
<div><a href="http://permalink.gmane.org/gmane.comp.lib.vtk.user/52639"></a>and</div><div><a href="http://comments.gmane.org/gmane.comp.lib.vtk.user/52679">http://comments.gmane.org/gmane.comp.lib.vtk.user/52679</a><br><br>
<div class="gmail_quote">On Wed, Nov 3, 2010 at 12:05 PM, Sebastien Jourdain <span dir="ltr">&lt;<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Jonathan,<br>
<br>
VTK is not thread safe at all. So you first should be aware of that.<br>
Then any Swing call should be made in the EDT (event dispatch thread.<br>
SwingUtilities.invokeLater..)<br>
To get a more precise answer, you will need to be more precise in your<br>
multi-threaded case...<br>
Once the VTK objects are connected to the renderer, they should only<br>
be updated through the EDT.<br>
<br>
Seb<br>
<div><div></div><div class="h5"><br>
On Wed, Nov 3, 2010 at 1:32 PM, Jonathan Morra &lt;<a href="mailto:jonmorra@gmail.com">jonmorra@gmail.com</a>&gt; wrote:<br>
&gt; I have an application that works fine in Java when the whole application is<br>
&gt; in one thread.  However, when I multi-thread the application<br>
&gt; I intermittently get the following error<br>
&gt; ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247<br>
&gt; vtkWin32OpenGLRenderWindow (000000005AE922B0): wglMakeCurrent failed in<br>
&gt; MakeCurrent(), error: The requested resource is in use.<br>
&gt; I don&#39;t know what is going on, but it only happens when I use Java threads.<br>
&gt; Does anyone know what&#39;s going on and how to fix it?<br>
&gt; Thanks<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br></div>