<div dir="ltr">vtkObject derived objects are not safe to access from multiple threads simultaneously. And since most of the KWWidgets objects derive from vtkObject... so the same is true for them.<br><br>vtkObject methods will execute on whatever thread you call them on. They are only guaranteed to work properly if you do all the access in a synchronized manner, using some sort of mutex mechanism to restrict access to a single thread at a time.<br>
<br>Best to avoid (*ahem*) stupid programming errors, I guess.<br><br>:-)<br>David<br><br><br><div class="gmail_quote">On Sun, Aug 31, 2008 at 12:45 PM, Peter Wainwright <span dir="ltr">&lt;<a href="mailto:prw@ceiriog.eclipse.co.uk">prw@ceiriog.eclipse.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I have a Python application which handles images. It uses a KWWidgets<br>
application and main window. &nbsp;By a stupid programming error (ahem...) I<br>
triggered an error during rendering. &nbsp;This caused the program to crash<br>
out with SIGSEGV. &nbsp;Examining the core dump (see the attachment) I found<br>
that VTK/KWWidgets was trying to handle the original error when the<br>
segfault occurred.<br>
<br>
Thread 1 (the thread in which the segfault occurred) was cloned from<br>
Thread 3 (the main thread). &nbsp;However, in the cloned thread, winPtr =<br>
Tk_MainWindow(interp) is NULL.<br>
<br>
My questions are:<br>
<br>
(1) Is it supposed to be legal to do Tk-related stuff in a thread like<br>
this (I know many widgets sets are not thread-safe)<br>
<br>
and<br>
<br>
(2) If this is not legal, why is VTK trying to invoke the error handler<br>
in the context of the sub-thread? &nbsp;Should it not somehow pass the error<br>
back to the main thread for processing?<br>
<br>
I am working with recent CVS head versions of VTK and KWWidgets on<br>
Ubuntu 8.04<br>
<br>
Thank you,<br>
<font color="#888888"><br>
Peter Wainwright<br>
<br>
</font><br>_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>