提交 6e96c2f8 编写于 作者: J jinhai

Merge branch 'branch-0.4.0' into 'branch-0.4.0'

Branch 0.4.0

See merge request megasearch/milvus!564

Former-commit-id: ec3428c4a18b17fcd1468db6dbbc61af4212d7fa
......@@ -283,8 +283,8 @@ if(DEFINED ENV{MILVUS_BOOST_URL})
else()
string(REPLACE "." "_" BOOST_VERSION_UNDERSCORES ${BOOST_VERSION})
set(BOOST_SOURCE_URL
"https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORES}.tar.gz"
)
"http://192.168.1.201/artifactory/generic-local/tools/boost_${BOOST_VERSION_UNDERSCORES}.tar.gz")
# "https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORES}.tar.gz"
endif()
set(BOOST_MD5 "fea771fe8176828fabf9c09242ee8c26")
......
......@@ -20,6 +20,8 @@ namespace engine {
static constexpr size_t PARALLEL_REDUCE_THRESHOLD = 10000;
static constexpr size_t PARALLEL_REDUCE_BATCH = 1000;
std::mutex XSearchTask::merge_mutex_;
//bool
//NeedParallelReduce(uint64_t nq, uint64_t topk) {
// server::ServerConfig &config = server::ServerConfig::GetInstance();
......@@ -269,6 +271,7 @@ Status XSearchTask::MergeResult(SearchContext::Id2DistanceMap &distance_src,
return Status::OK();
}
merge_mutex_.lock();
if (distance_target.empty()) {
distance_target.swap(distance_src);
return Status::OK();
......@@ -328,6 +331,7 @@ Status XSearchTask::MergeResult(SearchContext::Id2DistanceMap &distance_src,
}
distance_target.swap(distance_merged);
merge_mutex_.unlock();
return Status::OK();
}
......
......@@ -48,6 +48,8 @@ public:
int index_type_ = 0;
ExecutionEnginePtr index_engine_ = nullptr;
bool metric_l2 = true;
static std::mutex merge_mutex_;
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册