{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/211497976","pull_request_review_id":147927118,"id":211497976,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTQ5Nzk3Ng==","diff_hunk":"@@ -113,11 +118,15 @@ bool RequestPrefetchHandler::Handle(const std::string& varname,\n                                     const std::string& out_var_name) {\n   VLOG(4) << \"RequestPrefetchHandler \" << varname;\n \n-  auto var_desc = program_->Block(0).FindVar(out_var_name);\n-  InitializeVariable(*outvar, var_desc->GetType());\n-  executor_->RunPreparedContext(\n-      (*prefetch_var_name_to_prepared_ctx_)[varname].get(), scope);\n-\n+  // All execution should use thread in the thread pool to do.\n+  std::future<void> ft =\n+      framework::Async([this, &scope, &varname, &out_var_name, &outvar]() {\n+        auto var_desc = program_->Block(0).FindVar(out_var_name);\n+        InitializeVariable(*outvar, var_desc->GetType());\n+        executor_->RunPreparedContext(\n+            (*prefetch_var_name_to_prepared_ctx_)[varname].get(), scope);\n+      });\n+  ft.wait();","path":"paddle/fluid/operators/distributed/request_handler_impl.cc","position":50,"original_position":50,"commit_id":"c6814147d5d53b0d6061c26ba5b5ef922a9a9975","original_commit_id":"c6814147d5d53b0d6061c26ba5b5ef922a9a9975","user":{"login":"jacquesqiao","id":3048612,"node_id":"MDQ6VXNlcjMwNDg2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"body":"If `RequestPrefetchHandler::Handle` is in thread_pool, then this change is not needed.","created_at":"2018-08-21T07:04:11Z","updated_at":"2018-08-21T07:04:11Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/12790#discussion_r211497976","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/211497976"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/12790#discussion_r211497976"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790"}},"in_reply_to_id":211491621},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790","id":209346304,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MzQ2MzA0","html_url":"https://github.com/PaddlePaddle/Paddle/pull/12790","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/12790.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/12790.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12790","number":12790,"state":"open","locked":false,"title":"Optimize pserver thread pool","user":{"login":"jacquesqiao","id":3048612,"node_id":"MDQ6VXNlcjMwNDg2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-19T07:02:32Z","updated_at":"2018-08-21T07:04:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c01d5d4cfc77dc3245c5a01a9e4aca62d5b6fb6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Yancey1989","id":1426912,"node_id":"MDQ6VXNlcjE0MjY5MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1426912?v=4","gravatar_id":"","url":"https://api.github.com/users/Yancey1989","html_url":"https://github.com/Yancey1989","followers_url":"https://api.github.com/users/Yancey1989/followers","following_url":"https://api.github.com/users/Yancey1989/following{/other_user}","gists_url":"https://api.github.com/users/Yancey1989/gists{/gist_id}","starred_url":"https://api.github.com/users/Yancey1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yancey1989/subscriptions","organizations_url":"https://api.github.com/users/Yancey1989/orgs","repos_url":"https://api.github.com/users/Yancey1989/repos","events_url":"https://api.github.com/users/Yancey1989/events{/privacy}","received_events_url":"https://api.github.com/users/Yancey1989/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12790/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/c6814147d5d53b0d6061c26ba5b5ef922a9a9975","head":{"label":"jacquesqiao:optimize-pserver-thread-pool","ref":"optimize-pserver-thread-pool","sha":"c6814147d5d53b0d6061c26ba5b5ef922a9a9975","user":{"login":"jacquesqiao","id":3048612,"node_id":"MDQ6VXNlcjMwNDg2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"repo":{"id":75146336,"node_id":"MDEwOlJlcG9zaXRvcnk3NTE0NjMzNg==","name":"Paddle","full_name":"jacquesqiao/Paddle","owner":{"login":"jacquesqiao","id":3048612,"node_id":"MDQ6VXNlcjMwNDg2MTI=","avatar_url":"https://avatars0.githubusercontent.com/u/3048612?v=4","gravatar_id":"","url":"https://api.github.com/users/jacquesqiao","html_url":"https://github.com/jacquesqiao","followers_url":"https://api.github.com/users/jacquesqiao/followers","following_url":"https://api.github.com/users/jacquesqiao/following{/other_user}","gists_url":"https://api.github.com/users/jacquesqiao/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquesqiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquesqiao/subscriptions","organizations_url":"https://api.github.com/users/jacquesqiao/orgs","repos_url":"https://api.github.com/users/jacquesqiao/repos","events_url":"https://api.github.com/users/jacquesqiao/events{/privacy}","received_events_url":"https://api.github.com/users/jacquesqiao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquesqiao/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/jacquesqiao/Paddle","forks_url":"https://api.github.com/repos/jacquesqiao/Paddle/forks","keys_url":"https://api.github.com/repos/jacquesqiao/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquesqiao/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquesqiao/Paddle/teams","hooks_url":"https://api.github.com/repos/jacquesqiao/Paddle/hooks","issue_events_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/jacquesqiao/Paddle/events","assignees_url":"https://api.github.com/repos/jacquesqiao/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/jacquesqiao/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/jacquesqiao/Paddle/tags","blobs_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquesqiao/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquesqiao/Paddle/languages","stargazers_url":"https://api.github.com/repos/jacquesqiao/Paddle/stargazers","contributors_url":"https://api.github.com/repos/jacquesqiao/Paddle/contributors","subscribers_url":"https://api.github.com/repos/jacquesqiao/Paddle/subscribers","subscription_url":"https://api.github.com/repos/jacquesqiao/Paddle/subscription","commits_url":"https://api.github.com/repos/jacquesqiao/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquesqiao/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquesqiao/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacquesqiao/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/jacquesqiao/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquesqiao/Paddle/merges","archive_url":"https://api.github.com/repos/jacquesqiao/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquesqiao/Paddle/downloads","issues_url":"https://api.github.com/repos/jacquesqiao/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/jacquesqiao/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquesqiao/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquesqiao/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquesqiao/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/jacquesqiao/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/jacquesqiao/Paddle/deployments","created_at":"2016-11-30T03:13:08Z","updated_at":"2018-08-08T05:37:15Z","pushed_at":"2018-08-21T03:07:58Z","git_url":"git://github.com/jacquesqiao/Paddle.git","ssh_url":"git@github.com:jacquesqiao/Paddle.git","clone_url":"https://github.com/jacquesqiao/Paddle.git","svn_url":"https://github.com/jacquesqiao/Paddle","homepage":"http://www.paddlepaddle.org/","size":82780,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"e5674f6ddef7a8da448a48f0424e811d44a3d7ea","user":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"node_id":"MDEwOlJlcG9zaXRvcnk2NTcxMTUyMg==","name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2018-08-21T06:51:48Z","pushed_at":"2018-08-21T06:50:49Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":123833,"stargazers_count":7442,"watchers_count":7442,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2031,"mirror_url":null,"archived":false,"open_issues_count":606,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2031,"open_issues":606,"watchers":7442,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/12790"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12790"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12790/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12790/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/c6814147d5d53b0d6061c26ba5b5ef922a9a9975"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jacquesqiao"}}