This commit is contained in:
yefeng 2022-11-22 15:02:21 +08:00
parent 4b98342ca1
commit 806ceab605
2 changed files with 12 additions and 0 deletions

View File

@ -68,6 +68,10 @@ public class ModelParallelRunner {
rwLock.writeLock().unlock();
return false;
}
if (modelParallelRunnerPtr != 0L){
rwLock.writeLock().unlock();
return true;
}
modelParallelRunnerPtr = this.init(modelPath, runnerConfig.getRunnerConfigPtr());
rwLock.writeLock().unlock();
return modelParallelRunnerPtr != 0L;
@ -85,6 +89,10 @@ public class ModelParallelRunner {
rwLock.writeLock().unlock();
return false;
}
if (modelParallelRunnerPtr != 0L){
rwLock.writeLock().unlock();
return true;
}
modelParallelRunnerPtr = this.init(modelPath, 0L);
rwLock.writeLock().unlock();
return modelParallelRunnerPtr != 0;

View File

@ -204,6 +204,10 @@ Status ResourceManager::DistinguishPhysicalAndLogicalByNuma(std::vector<std::vec
}
void InitWorkerThread::Destroy() {
if (model_worker_ != nullptr) {
predict_task_queue_->SetPredictTaskDone();
predict_task_queue_ = nullptr;
}
std::unique_lock<std::mutex> l(mtx_init_);
is_destroy_ = true;
is_launch_ = true;