<div dir="ltr">Hi Kit,<br><br>You are correct, you will run into issues trying to share the filter between threads since they are stateful. You'll need to manually create and configure a new filter for each thread.<br><br>The VruiVTK project has done something similar, but it executes isolated data pipelines in a single background thread while doing threaded rendering to multiple OpenGL contexts, including thread safe data transfer between data<->render pipelines. Might be worth poking around in it and see if anything useful pops out.<br><br>VruiVTK library: <a href="https://github.com/VruiVTK/vtkVRUI">https://github.com/VruiVTK/vtkVRUI</a><br>MooseViewer (uses VruiVTK, the "mvClassName" classes are relevant to threading): <a href="https://github.com/VruiVTK/MooseViewer">https://github.com/VruiVTK/MooseViewer</a><br><br>Be warned that there are dragons lurking -- the pipeline/filter system itself is thread safe when done carefully, but some utilities in VTK (e.g. text rendering) use single-threaded external libraries or process-wide globals that can bite you. For just crunching some data, though, you should be fine.<br><br>HTH,<br>Allie</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 5, 2018 at 11:39 AM, Kit Chambers <span dir="ltr"><<a href="mailto:kit.chambers.kc@gmail.com" target="_blank">kit.chambers.kc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am looking to write a VTK filter which contains a series of sub filters which are executed in parallel inside an OpenMP loop. The RequestData would look something like this:<br>
<br>
1- Set up the the filters (filter1 -> filter2 -> filter3), this sequence might change between different usages.<br>
2- Start threading / create the parallel region<br>
3- Parallel loop over some different inputs<br>
3a - Set filter1 input<br>
3b - Execute the filter series<br>
3c - Add the result to output<br>
<br>
Would I be correct in thinking that the above will result in a conflict where filter inputs and outputs get over written by successive threads? If so then is there a handy way to create a thread local copy of the VTK filters between steps 2 and 3?<br>
<br>
Any help would be appreciated.<br>
<br>
Kit<br>
<br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://vtk.org/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtkusers</a><br>
</blockquote></div><br></div>