[vtkusers] multithreading java applications

Sebastien Jourdain sebastien.jourdain at kitware.com
Wed Nov 3 15:05:00 EDT 2010


Hi Jonathan,

VTK is not thread safe at all. So you first should be aware of that.
Then any Swing call should be made in the EDT (event dispatch thread.
SwingUtilities.invokeLater..)
To get a more precise answer, you will need to be more precise in your
multi-threaded case...
Once the VTK objects are connected to the renderer, they should only
be updated through the EDT.

Seb

On Wed, Nov 3, 2010 at 1:32 PM, Jonathan Morra <jonmorra at gmail.com> wrote:
> I have an application that works fine in Java when the whole application is
> in one thread.  However, when I multi-thread the application
> I intermittently get the following error
> ERROR: In ..\..\src\Rendering\vtkWin32OpenGLRenderWindow.cxx, line 247
> vtkWin32OpenGLRenderWindow (000000005AE922B0): wglMakeCurrent failed in
> MakeCurrent(), error: The requested resource is in use.
> I don't know what is going on, but it only happens when I use Java threads.
> Does anyone know what's going on and how to fix it?
> Thanks
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list