[vtkusers] FindCell in multithreaded application
Jim Peterson
jimcp at cox.net
Sun Oct 31 11:29:20 EDT 2010
John Haiducek wrote:
> On Sat, 2010-10-30 at 14:39 -0400, Jim Peterson wrote:
>
>> John,
>>
>> Just curious, where did you get the original premise that protecting the
>> first call to FindCell would make all calls threadsafe? Was that in a
>> VTK usage recomendation or document somewhere?
>>
>> Thanks,
>> Jim
>>
>
> In the documentation for vtkDataSet it says: THIS METHOD IS THREAD SAFE
> IF FIRST CALLED FROM A SINGLE THREAD AND THE DATASET IS NOT MODIFIED.
> That's for the second version of FindCell, which takes a vtkGenericCell
> as a parameter. I may be misunderstanding it, but I thought the text in
> all caps meant that it's thread-safe as long as the first call is
> protected.
>
> John
>
>
>
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?
HTH,
Jim
HTH,
Jim
More information about the vtkusers
mailing list