[vtkusers] thread safety

David E DeMarle dave.demarle at kitware.com
Wed Aug 29 12:14:54 EDT 2012


Unfortunately, VTK isn't thread safe, with the exception being
operations (mostly limited to array access methods that are declared
to be thread safe in doxygen) that take place in the Threaded* methods
in subclasses of vtkThreadedImageAlgorithm.

Berk is working on more wide scale thread/SMP parallel support, but
that won't be in until after 6.0.

If anyone on the list has had success in writing multithreaded VTK
programs, I'ld like to see examples along with descriptions of what
your approach was and what you had to mutex protect.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Wed, Aug 29, 2012 at 2:47 AM, Lodron, Gerald
<Gerald.Lodron at joanneum.at> wrote:
> Hi
>
> I programmed an own vtk Filter which internally has multiple threads. In
> each thread I create a vtkImageData object using
>
> vtkSmartPointer<vtkImageData>       oImage = vtkImageData::New();
>
> the problem is that sometimes the New() operator crashes, I debugged it the
> the line 61 of vtkImageData.cxx:
>
> this->Information->Set(vtkDataObject::DATA_EXTENT(), this->Extent, 6);
>
> whereby the exact crash is in vtkInformationIntegerPointerKey.cxx on line
> 58:
>
> if(this->RequiredLength >= 0 && length != this->RequiredLength)
>
> wherehy the “this” pointer is zero. I am not so deep familiar with that, any
> suggestions?
>
> DI Gerald Lodron
>
> Machine Vision Applications
>
> DIGITAL - Institute for Information and Communication Technologies
>
> JOANNEUM RESEARCH Forschungsgesellschaft mbH
> Steyrergasse 17, 8010 Graz, AUSTRIA
>
> phone:   +43-316-876-1751       personal fax: +43-316-876-91751
> mobile:   +43-699-1876-1751      general fax: +43-316-876-1720
> web: http://www.joanneum.at/digital
> e-mail: gerald.lodron at joanneum.at
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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