Support bayes and kmeans for concurrency