提交 0fa0cd7b 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!4710 Fix tfreader multi-thread issue

Merge pull request !4710 from xiefangqi/xfq_fix_tfreader_issue
......@@ -238,6 +238,9 @@ Status TFReaderOp::CalculateNumRowsPerShard() {
Status TFReaderOp::operator()() {
RETURN_IF_NOT_OK(CalculateNumRowsPerShard());
// Put here to avoid register failed when Worker_Entry thread exits unexpected
RETURN_IF_NOT_OK(io_block_queue_wait_post_.Register(tree_->AllTasks()));
// launch one thread, responsible for filling mIOBlockQueue
RETURN_IF_NOT_OK(tree_->LaunchWorkers(1, std::bind(&TFReaderOp::WaitToFillIOBlockQueue, this)));
......@@ -250,8 +253,6 @@ Status TFReaderOp::operator()() {
// so workers have to be kept alive until the end of the program
TaskManager::FindMe()->Post();
RETURN_IF_NOT_OK(io_block_queue_wait_post_.Register(tree_->AllTasks()));
NotifyToFillIOBlockQueue();
while (!finished_reading_dataset_) {
int64_t buffer_id = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册