single thread knn