[vtkusers] Threading

xabi riobe xabivtk at gmail.com
Mon Jan 29 03:53:59 EST 2007


Hello Lars,

I can't help you for the thread issue, but if you want to see the
message error, use vtkFileOutputWindow to keep the messages in a log
file.

hth,

XR


2007/1/29, Lars Friedrich <lfriedri at imtek.de>:
> Hello,
>
> from the VTK docs I get that VTK is generally not thread safe. I guess
> that this basically means that one has to take care that not two
> interfering requests to the library are made at the same time. I tried
> the following from python:
>
> #*****************
> from threading import Thread
> from time import sleep
>
> import vtk as V
>
> w = V.vtkRenderWindow()
> ren = V.vtkRenderer()
> w.AddRenderer(ren)
>
> class vtkThread(Thread):
> 	def __init__(self, win):
> 		Thread.__init__(self)
> 		self.win = win
> 	def run(self):
> 		for i in range(10):
> 			self.win.Render()
> 			sleep(1)
>
> t = vtkThread(w)
>
> t.start()
> t.join()
> #*****************
>
> On my Linux machine this runs fine. It displays the black VTKwindow I
> wanted to see.
>
> On Windows however, the VTKwindow first is black (as expected) but gets
> white when I try to move it around. After the ten seconds are over, I
> get a window with some error messages in, but it is displayed very
> shortly, so I cannot read anything.
>
> What am I doing wrong?
>
> Thanks for every comment
>
> Lars
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the 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