kakao / n2

TOROS N2 - lightweight approximate Nearest Neighbor library which runs fast even with large datasets
Apache License 2.0
567 stars 71 forks source link

multithreaded calls to SearchById() and SearchByVector() #23

Closed pkharchenko closed 6 years ago

pkharchenko commented 6 years ago

Great package! I was wondering if the SearchById() and SearchByVector() methods are supposed to be thread-safe? Getting different answers when I use "omp parallel for" clause looping over the set of Ids I am looking up. Thanks!

corona10 commented 6 years ago

@pkharchenko Unfortunately, If SearchById() and SearchByVector() are executed by multiple threads. The race condition occurs due to the searchlist. As the result, They are not thread-safe.