[vtkusers] FindCell in multithreaded application

John Haiducek jhaiduce at gmail.com
Mon Nov 1 19:23:05 EDT 2010


On Sun, Oct 31, 2010 at 9:29 AM, Jim Peterson <jimcp at cox.net> wrote:

>
> John,
> Thanks for that, I think the part that needs clarification to me is what
> exactly is intended by the phrase "If first called from a single thread".
>
> To anyone who can illuminate this threadsafe reference:
> Can someone explain how there can be a first call not from a single thread?
> Single threaded use does not constitute "Thread Safe" to me, in fact, if all
> calls must be from a single thread, I would call it "Not Thread Safe"
> personally. Are all subsequent calls supposed to specify the same
> vtkGenericCell? Is the suggestion of "thread safe" suggesting the generated
> logic may result in multiple threads?
>

Thank you Jim and Bill for looking in to this. After examining a backgrace
from the crash, I notice that the actual segfault happens on a call to
vtkPointLocator::FreeSearchStructure(), which is called by
vtkPointLocator::FindClosestPoint(). The documentation for
vtkPointLocator::FindClosestPoint() says it is thread-safe with a similar
caveat: "These methods are thread safe if
BuildLocator()<http://www.vtk.org/doc/release/5.0/html/a01870.html#z1249_3>is
directly or indirectly called from a single thread first." Still not
sure
whether "if first called from a single thread" means the first call must be
protected by a mutex or if there is some other requirement, or whether I'm
supposed to use the same vtkGenericCell or create a new one for each call
(or for each thread).

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101101/7cc06974/attachment.htm>


More information about the vtkusers mailing list