{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/165550729","pull_request_review_id":93510563,"id":165550729,"diff_hunk":"@@ -125,3 +125,39 @@ TEST(Channel, UnbufferedLessReceiveMoreSendTest) {\n   t.join();\n   delete ch;\n }\n+\n+TEST(Channel, UnbufferedMoreReceiveLessSendTest) {\n+  auto ch = MakeChannel<int>(0);\n+  unsigned sum_send = 0;\n+  unsigned sum_receive = 0;\n+  // The receiver should block after 5\n+  // iterations, since there are only 5 senders.\n+  std::thread t([&]() {\n+    for (int i = 0; i < 8; i++) {\n+      int recv;\n+      ch->Receive(&recv);  // should block after the fifth iteration.\n+      EXPECT_EQ(recv, i);\n+      sum_receive += i;\n+    }\n+  });\n+  for (int i = 0; i < 5; i++) {\n+    ch->Send(&i);\n+    sum_send += i;\n+  }\n+  std::this_thread::sleep_for(std::chrono::milliseconds(100));  // wait 0.5 sec\n+  EXPECT_EQ(sum_send, 10U);\n+  EXPECT_EQ(sum_receive, 10U);\n+  EXPECT_EQ(sum_send, sum_receive);\n+  // send three more elements\n+  for (int i = 5; i < 8; i++) {\n+    ch->Send(&i);\n+    sum_send += i;\n+  }\n+\n+  CloseChannel(ch);\n+  t.join();\n+  EXPECT_EQ(sum_send, 28U);\n+  EXPECT_EQ(sum_receive, 28U);\n+  EXPECT_EQ(sum_send, sum_receive);","path":"paddle/framework/channel_test.cc","position":46,"original_position":46,"commit_id":"148197270c336deaf856fc3d90404f96325becd2","original_commit_id":"148197270c336deaf856fc3d90404f96325becd2","user":{"login":"chengduoZH","id":30176695,"avatar_url":"https://avatars2.githubusercontent.com/u/30176695?v=4","gravatar_id":"","url":"https://api.github.com/users/chengduoZH","html_url":"https://github.com/chengduoZH","followers_url":"https://api.github.com/users/chengduoZH/followers","following_url":"https://api.github.com/users/chengduoZH/following{/other_user}","gists_url":"https://api.github.com/users/chengduoZH/gists{/gist_id}","starred_url":"https://api.github.com/users/chengduoZH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chengduoZH/subscriptions","organizations_url":"https://api.github.com/users/chengduoZH/orgs","repos_url":"https://api.github.com/users/chengduoZH/repos","events_url":"https://api.github.com/users/chengduoZH/events{/privacy}","received_events_url":"https://api.github.com/users/chengduoZH/received_events","type":"User","site_admin":false},"body":"The same above.","created_at":"2018-02-02T03:23:22Z","updated_at":"2018-02-02T03:23:30Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/8061#discussion_r165550729","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/165550729"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/8061#discussion_r165550729"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061","id":166680351,"html_url":"https://github.com/PaddlePaddle/Paddle/pull/8061","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/8061.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/8061.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8061","number":8061,"state":"open","locked":false,"title":"Added more receivers less senders. Receivers should block.","user":{"login":"kavyasrinet","id":5814583,"avatar_url":"https://avatars2.githubusercontent.com/u/5814583?v=4","gravatar_id":"","url":"https://api.github.com/users/kavyasrinet","html_url":"https://github.com/kavyasrinet","followers_url":"https://api.github.com/users/kavyasrinet/followers","following_url":"https://api.github.com/users/kavyasrinet/following{/other_user}","gists_url":"https://api.github.com/users/kavyasrinet/gists{/gist_id}","starred_url":"https://api.github.com/users/kavyasrinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavyasrinet/subscriptions","organizations_url":"https://api.github.com/users/kavyasrinet/orgs","repos_url":"https://api.github.com/users/kavyasrinet/repos","events_url":"https://api.github.com/users/kavyasrinet/events{/privacy}","received_events_url":"https://api.github.com/users/kavyasrinet/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-01T23:26:23Z","updated_at":"2018-02-02T03:23:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85b9c7a7bef38ebc5725fe6bd0ea23d8b38a3f2f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8061/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/148197270c336deaf856fc3d90404f96325becd2","head":{"label":"kavyasrinet:chan1","ref":"chan1","sha":"148197270c336deaf856fc3d90404f96325becd2","user":{"login":"kavyasrinet","id":5814583,"avatar_url":"https://avatars2.githubusercontent.com/u/5814583?v=4","gravatar_id":"","url":"https://api.github.com/users/kavyasrinet","html_url":"https://github.com/kavyasrinet","followers_url":"https://api.github.com/users/kavyasrinet/followers","following_url":"https://api.github.com/users/kavyasrinet/following{/other_user}","gists_url":"https://api.github.com/users/kavyasrinet/gists{/gist_id}","starred_url":"https://api.github.com/users/kavyasrinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavyasrinet/subscriptions","organizations_url":"https://api.github.com/users/kavyasrinet/orgs","repos_url":"https://api.github.com/users/kavyasrinet/repos","events_url":"https://api.github.com/users/kavyasrinet/events{/privacy}","received_events_url":"https://api.github.com/users/kavyasrinet/received_events","type":"User","site_admin":false},"repo":{"id":105198421,"name":"Paddle","full_name":"kavyasrinet/Paddle","owner":{"login":"kavyasrinet","id":5814583,"avatar_url":"https://avatars2.githubusercontent.com/u/5814583?v=4","gravatar_id":"","url":"https://api.github.com/users/kavyasrinet","html_url":"https://github.com/kavyasrinet","followers_url":"https://api.github.com/users/kavyasrinet/followers","following_url":"https://api.github.com/users/kavyasrinet/following{/other_user}","gists_url":"https://api.github.com/users/kavyasrinet/gists{/gist_id}","starred_url":"https://api.github.com/users/kavyasrinet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kavyasrinet/subscriptions","organizations_url":"https://api.github.com/users/kavyasrinet/orgs","repos_url":"https://api.github.com/users/kavyasrinet/repos","events_url":"https://api.github.com/users/kavyasrinet/events{/privacy}","received_events_url":"https://api.github.com/users/kavyasrinet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kavyasrinet/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/kavyasrinet/Paddle","forks_url":"https://api.github.com/repos/kavyasrinet/Paddle/forks","keys_url":"https://api.github.com/repos/kavyasrinet/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kavyasrinet/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kavyasrinet/Paddle/teams","hooks_url":"https://api.github.com/repos/kavyasrinet/Paddle/hooks","issue_events_url":"https://api.github.com/repos/kavyasrinet/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/kavyasrinet/Paddle/events","assignees_url":"https://api.github.com/repos/kavyasrinet/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/kavyasrinet/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/kavyasrinet/Paddle/tags","blobs_url":"https://api.github.com/repos/kavyasrinet/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kavyasrinet/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kavyasrinet/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/kavyasrinet/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kavyasrinet/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/kavyasrinet/Paddle/languages","stargazers_url":"https://api.github.com/repos/kavyasrinet/Paddle/stargazers","contributors_url":"https://api.github.com/repos/kavyasrinet/Paddle/contributors","subscribers_url":"https://api.github.com/repos/kavyasrinet/Paddle/subscribers","subscription_url":"https://api.github.com/repos/kavyasrinet/Paddle/subscription","commits_url":"https://api.github.com/repos/kavyasrinet/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/kavyasrinet/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/kavyasrinet/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/kavyasrinet/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/kavyasrinet/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/kavyasrinet/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kavyasrinet/Paddle/merges","archive_url":"https://api.github.com/repos/kavyasrinet/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kavyasrinet/Paddle/downloads","issues_url":"https://api.github.com/repos/kavyasrinet/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/kavyasrinet/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/kavyasrinet/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/kavyasrinet/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kavyasrinet/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/kavyasrinet/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/kavyasrinet/Paddle/deployments","created_at":"2017-09-28T20:55:39Z","updated_at":"2017-09-28T20:55:45Z","pushed_at":"2018-02-02T01:40:22Z","git_url":"git://github.com/kavyasrinet/Paddle.git","ssh_url":"git@github.com:kavyasrinet/Paddle.git","clone_url":"https://github.com/kavyasrinet/Paddle.git","svn_url":"https://github.com/kavyasrinet/Paddle","homepage":"http://www.paddlepaddle.org/","size":68595,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"148d35feb8fbd6c0cee7c66268d316e4274b8407","user":{"login":"PaddlePaddle","id":23534030,"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,"name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"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-02-01T12:55:28Z","pushed_at":"2018-02-02T03:05:34Z","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":87835,"stargazers_count":6366,"watchers_count":6366,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1677,"mirror_url":null,"archived":false,"open_issues_count":1185,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1677,"open_issues":1185,"watchers":6366,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/8061"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8061"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/8061/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/8061/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/148197270c336deaf856fc3d90404f96325becd2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chengduoZH"}}