[vtkusers] VTK & C++/CLI in a multi-threaded application

ianl ilindsay at insigniamedical.co.uk
Mon Jan 21 12:40:49 EST 2013


Hi, as one of the other 5 people using C++/CLI, welcome!

We had similar issues in our application and ended up writing a specialised
class that marshalls all vtk usage into a single thread. It seems that VTK
has some global data structures behind the scenes for some classes
(generally the heavier weight OpenGL wrapping ones) which are not thread
protected. This even applies when accessing the objects in the same thread
they were created in if multiple threads are running.

Providing all VTK functionality is accessed from one thread, we have found
that all is fine. Note that this does not necessarily need to be the GUI
thread. Also, some of the simpler classes like vtkMatrix4x4, etc are fine
when used in separate threads. This approach seems to work both in 32 and 64
bit builds.

Hope that helps.
Ian



--
View this message in context: http://vtk.1045678.n5.nabble.com/VTK-C-CLI-in-a-multi-threaded-application-tp5717893p5718043.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list