[vtkusers] Multithreading and VTK

Berk Geveci berk.geveci at kitware.com
Thu Sep 11 13:21:31 EDT 2003


Although this is not what I would do in your situation, it is
possible. There are a few things to be aware of:
1. If you are visualizing the output of the simulation in the
VTK thread, you have to make sure that VTK does not access
the data while the simulation is writing it
2. Never, ever, ever render from two threads
3. Two threads can not share VTK filters or any other pipeline
objects
4. Two threads can have independent pipelines, working
on independent data 
5. If two threads share data, you are responsible of creating
the necessary mutexes to avoid access violations

-Berk

On Thu, 2003-09-11 at 10:37, Ben Harris wrote:
> Hello all,
> 
> After referring to the books, and online documentation, and searching 
> the vtkusers list, I am still stumped.
> 
> Is it possible for a RenderWindowInteractor to process events and 
> control the camera on one thread, while on another thread a simulation 
> is running? At the heart of this question, I believe, is the level of 
> thread-safety associated with the visualization pipeline.
> 
> Here is my application: I am writing an N-body simulation--a numerical 
> simulation of celestial bodies which move due to gravitational 
> interaction. I would like to run the simulation while allowing the user 
> to pan and zoom the camera.
> 
> Thanks in advance,
> Ben Harris





More information about the vtkusers mailing list