Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/VecSim/algorithms/svs/svs_tiered.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class TieredSVSIndex : public VecSimTieredIndex<DataType, float> {
std::atomic_flag indexUpdateScheduled = ATOMIC_FLAG_INIT;
// Used to prevent running multiple index update jobs in parallel.
// Even if update jobs scheduled sequentially, they can be started in parallel.
std::mutex updateJobMutex;
mutable std::mutex updateJobMutex;

// The reason of following container just to properly destroy jobs which not executed yet
SVSMultiThreadJob::JobsRegistry uncompletedJobs;
Expand Down Expand Up @@ -880,6 +880,8 @@ class TieredSVSIndex : public VecSimTieredIndex<DataType, float> {
.indexUpdateScheduled =
static_cast<bool>(this->indexUpdateScheduled.test())};
info.tieredInfo.specificTieredBackendInfo.svsTieredInfo = svsTieredInfo;
// prevent parallel updates
std::lock_guard<std::mutex> lock(this->updateJobMutex);
info.tieredInfo.backgroundIndexing =
svsTieredInfo.indexUpdateScheduled && info.tieredInfo.frontendCommonInfo.indexSize > 0
? VecSimBool_TRUE
Expand Down
Loading