Race condition in vtkImprintFilter
I believe there is a race condition in the following code in vtkImprintFilter
Using vtkSMPTools::For
in GeometricClassify
(here) the vtkTargetPointClassifier
loops through each cell in parallel. However, for each cell, the PtClassification
vector is read and written to for each point in the cell. Because multiple cells can contain the same point, we could have multiple threads reading/writing to the same place in memory at the same time.
I believe that changing the function to loop over the points directly instead of looping over the cells would be the safer (and more efficient) solution.