<br><br><div class="gmail_quote">2009/11/18 Jason Remillard <span dir="ltr">&lt;<a href="mailto:remillard.jason@gmail.com">remillard.jason@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
<br>
Sorry if this has been asked before, but I was not able to figure out<br>
how to search over the list archives.<br>
<br>
I would like to build up a kdtree, then spawn multiple threads via<br>
openmp that will do parallel queries on the tree. The find,<br>
find_nearest, find_within_range, and visit_within_range are all<br>
declared as const. However, are they really const?<br>
 - Does calling them modify the state of the tree in anyway?<br>
 - Any cached data in the tree?<br>
 - Any intermediate data stored in the nodes?<br>
<br>
If the search functions write to any tree data then concurrent calls<br>
will not work.<br>
<br></blockquote><div><br></div><div>All the const methods are const-correct, to my knowledge.   This is important to me too.  Plus, there is no need to write anything during a search as there is no caching or intermediate data.</div>

<div><br></div><div>Note that your accessor and other classes you use with kdtree will also need to be thread-safe.</div><div><br></div><div>Also note that if you use something like visit_within_range(), the visitor is *copied* around (like other STL algorithms), so make sure that your visitor is fast to copy (use pointers or pimpl pattern or letter-envelope pattern or whatever you want to call it).</div>

<div><br></div><div>see ya</div><div>Paul</div><div><br></div></div>