[vtkusers] Multithreading woes....

Beau Sapach beau.sapach at ualberta.ca
Wed Mar 7 13:52:57 EST 2007


Hello everyone,

 

My goal is to create windows that display images using vtkImageActors.  I'd
like each of these windows to run in their own thread, so I'm using
CWinThread (MFC) to create all of the vtk related objects and link them
together.  Then the thread enters its own message loop, so to manipulate the
window the user uses the mouse, or the main application thread will send
messages to the child thread(s). During the thread's creation I pass it a
list of vtkImageData pointers that it uses as input for the vtkImageActor.
The vtkImageData list is created by the main application's thread.  Whenever
I change the input of the vtkImageActor the program breaks (typically in
free.c).  My guess is that by swapping in a new vtkImageData pointer the
pipeline tries to free memory in a non-theadsafe way.

 

I've tried this very same scenario using vtkTextActor and a list of CString
objects and it works without a hitch.  If anyone has any insight as to why
the vtkImageActor setup would fail please share!!  Thanks.


Beau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070307/85178d34/attachment.htm>


More information about the vtkusers mailing list