<div dir="ltr">Correction:<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">Render in one thread should _not_ cause filters that belong to another thread to execute.</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Best,</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">-berk</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 24, 2014 at 11:14 AM, Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Let me add my 2 cents.<div><br></div><div>First of all, make sure that you are using the latest VTK from Git. It makes reference count management thread safe. As long as the reference does not go to 0 while another thread is using an object, it will be fine. Using smart pointers will also be OK. Git VTK has bunch of other thread safety improvements by the way.</div>
<div><br></div><div>Second, when you hand data from the compute thread to the render thread, I would use a shallow copy. Something like:</div><div><br></div><div>copyToRender = output->NewInstance();</div><div>copyToRender->ShallowCopy(output);</div>
<div><br></div><div>Make sure that this is protected by a mutex if the compute thread eventually deletes "output". This would not be needed normally but there is still some garbage collection left that may cause issues. This should make it safe. It will be unnecessary in the future as we clean things more.</div>
<div><br></div><div>Finally, never connect a pipeline across threads. Render should cause filters that belong to another to execute.</div><div><br></div><div>If you are still running into specific thread safety issue, try to trace them with helgrind and please report them to this list or to me directly.</div>
<div><br></div><div>Best,</div><div>-berk</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Mon, Mar 24, 2014 at 11:00 AM, Aashish Chaudhary <span dir="ltr"><<a href="mailto:aashish.chaudhary@kitware.com" target="_blank">aashish.chaudhary@kitware.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>On Mon, Mar 24, 2014 at 10:53 AM, David Cole <span dir="ltr"><<a href="mailto:dlrdave@aol.com" target="_blank">dlrdave@aol.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Aashish,<br>
<br>
The blog post you pointed to was published in October 2012, and referenced releasing the source code by the end of 2013. Was the source code released? Is there a public repo for it?<br></blockquote><div><br></div></div><div>
At the end of the blog, Rusty answered this question. Please have a look at it. </div><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I find it hard to believe that the only thing you had to do was "a vtkSmartPointer trick"...<br></blockquote><div><br></div></div><div>It was not just that but it was part of the core implementation. </div><div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If there is a way to run, for example, the vtkMarchingCubes filter on a large volumetric dataset, with a pipeline that's in a background non-GUI thread, it sure would be useful to have a snippet of example code that proves it. Or any other long running vtkAlgorithm, for that matter.<br>
</blockquote><div><br></div></div><div>I don't remember what algorithms we ran but they were mostly image based or our own written in VTK. </div><div><br></div><div>- Aashish</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Thanks,<br>
David<br>
<br>
</blockquote></div><div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>
</div></div></div>
<br></div></div><div class="">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<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></div></blockquote></div><br></div>
</blockquote></div><br></div>