[vtkusers] accessing shared data

Andreas Brüning mail-andi at web.de
Fri Dec 5 10:57:18 EST 2008


Dear vtk-user,

i develope a multithreaded application in C++ and MFC and i have a question about the access of a shared datasource. This datasource is a vtkImageData object, enhanced by a Critical Section to syncronize the access. By the way, do i have to syncronize the access or does vtk handles it itself?

I have different threads (UI- Threads ) with completely independent vtk- pipelines with there own vtkWin32OpenglRenderWindows. They are communicating with each other and accessing the same datasource with a vtkImageReslice object. 
The easiest way to syncronize the access would be to call the Render -method inside the CriticalSection. I tried it and it works. But in this case i loose performance. Furthermore there are other objects displayed in the windows and if i change these objects and update the scene i also enter the critical section. 

So, does the Render method of the vtkWindow always call an Update() in every object of the pipline, or is there a way to update parts of the pipeline and the Render -method recognize it and dont call an update again?
I tried also the way only to call Update() of the vktReslice object inside the Critical Section when the parameter changed. This also works and is much faster. But if i want to close the application i get an error while cleaning vtk and there is an error while freeing the heap memory. 


Does anybody has expirience with this and can give me an advice how to minimize the accesstime of the Critical Section?

Sincerely 
Andi


  
_______________________________________________________________________
Sensationsangebot verlängert: WEB.DE FreeDSL - Telefonanschluss + DSL
für nur 16,37 Euro/mtl.!* http://dsl.web.de/?ac=OM.AD.AD008K13805B7069a




More information about the vtkusers mailing list