{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc/pulls/comments/205909134","pull_request_review_id":141280666,"id":205909134,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTkwOTEzNA==","diff_hunk":"@@ -135,12 +138,32 @@ struct grpc_resource_quota {\n \n   gpr_atm last_size;\n \n+  /* Mutex to protect max_threads and num_threads */\n+  /* Note: We could have used gpr_atm for max_threads and num_threads and avoid\n+   * having this mutex; but in that case, each invocation of the function\n+   * grpc_resource_user_alloc_threads() will have to do atleast two atomic loads\n+   * (for max_threads and num_threads) followed by a CAS (on num_threads).\n+   * Moreover, we expect grpc_resource_user_alloc_threads() to be often called\n+   * concurrently thereby increasing the chances of failing the CAS operation.\n+   * This additional complexity is not worth the tiny perf gain we may (or may\n+   * not) have by using atomics */\n+  gpr_mu thd_mu;","path":"src/core/lib/iomgr/resource_quota.cc","position":23,"original_position":23,"commit_id":"9bc8ee42c20385214027ced5991b9973a0282655","original_commit_id":"404d4f3a4d30226a75c7c5a8b74cdd4ece4846a0","user":{"login":"sreecha","id":2754995,"node_id":"MDQ6VXNlcjI3NTQ5OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/2754995?v=4","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-07-27T21:55:46Z","updated_at":"2018-07-27T21:55:47Z","html_url":"https://github.com/grpc/grpc/pull/16081#discussion_r205909134","pull_request_url":"https://api.github.com/repos/grpc/grpc/pulls/16081","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments/205909134"},"html":{"href":"https://github.com/grpc/grpc/pull/16081#discussion_r205909134"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16081"}},"in_reply_to_id":205162389},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc/pulls/16081","id":202969241,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyOTY5MjQx","html_url":"https://github.com/grpc/grpc/pull/16081","diff_url":"https://github.com/grpc/grpc/pull/16081.diff","patch_url":"https://github.com/grpc/grpc/pull/16081.patch","issue_url":"https://api.github.com/repos/grpc/grpc/issues/16081","number":16081,"state":"open","locked":false,"title":"Restrict the number of threads in C++ sync server","user":{"login":"sreecha","id":2754995,"node_id":"MDQ6VXNlcjI3NTQ5OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/2754995?v=4","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"body":"This implements the proposal here: \r\nhttps://github.com/grpc/proposal/blob/master/L30-Ability-to-restrict-max-threads-in-C%2B%2BSyncServer.md\r\n","created_at":"2018-07-20T22:24:06Z","updated_at":"2018-07-27T21:55:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c010accaa99f957e90a8cf8b1de5c09723ac4c73","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yang-g","id":10122250,"node_id":"MDQ6VXNlcjEwMTIyMjUw","avatar_url":"https://avatars0.githubusercontent.com/u/10122250?v=4","gravatar_id":"","url":"https://api.github.com/users/yang-g","html_url":"https://github.com/yang-g","followers_url":"https://api.github.com/users/yang-g/followers","following_url":"https://api.github.com/users/yang-g/following{/other_user}","gists_url":"https://api.github.com/users/yang-g/gists{/gist_id}","starred_url":"https://api.github.com/users/yang-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yang-g/subscriptions","organizations_url":"https://api.github.com/users/yang-g/orgs","repos_url":"https://api.github.com/users/yang-g/repos","events_url":"https://api.github.com/users/yang-g/events{/privacy}","received_events_url":"https://api.github.com/users/yang-g/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc/pulls/16081/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc/pulls/16081/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc/issues/16081/comments","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/9bc8ee42c20385214027ced5991b9973a0282655","head":{"label":"sreecha:rq-threads","ref":"rq-threads","sha":"9bc8ee42c20385214027ced5991b9973a0282655","user":{"login":"sreecha","id":2754995,"node_id":"MDQ6VXNlcjI3NTQ5OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/2754995?v=4","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"repo":{"id":43380244,"node_id":"MDEwOlJlcG9zaXRvcnk0MzM4MDI0NA==","name":"grpc","full_name":"sreecha/grpc","owner":{"login":"sreecha","id":2754995,"node_id":"MDQ6VXNlcjI3NTQ5OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/2754995?v=4","gravatar_id":"","url":"https://api.github.com/users/sreecha","html_url":"https://github.com/sreecha","followers_url":"https://api.github.com/users/sreecha/followers","following_url":"https://api.github.com/users/sreecha/following{/other_user}","gists_url":"https://api.github.com/users/sreecha/gists{/gist_id}","starred_url":"https://api.github.com/users/sreecha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sreecha/subscriptions","organizations_url":"https://api.github.com/users/sreecha/orgs","repos_url":"https://api.github.com/users/sreecha/repos","events_url":"https://api.github.com/users/sreecha/events{/privacy}","received_events_url":"https://api.github.com/users/sreecha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sreecha/grpc","description":"The C based gRPC (C++, Node.js, Python, Ruby, Objective-C, PHP, C#)","fork":true,"url":"https://api.github.com/repos/sreecha/grpc","forks_url":"https://api.github.com/repos/sreecha/grpc/forks","keys_url":"https://api.github.com/repos/sreecha/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sreecha/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sreecha/grpc/teams","hooks_url":"https://api.github.com/repos/sreecha/grpc/hooks","issue_events_url":"https://api.github.com/repos/sreecha/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/sreecha/grpc/events","assignees_url":"https://api.github.com/repos/sreecha/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/sreecha/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/sreecha/grpc/tags","blobs_url":"https://api.github.com/repos/sreecha/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sreecha/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sreecha/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/sreecha/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sreecha/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/sreecha/grpc/languages","stargazers_url":"https://api.github.com/repos/sreecha/grpc/stargazers","contributors_url":"https://api.github.com/repos/sreecha/grpc/contributors","subscribers_url":"https://api.github.com/repos/sreecha/grpc/subscribers","subscription_url":"https://api.github.com/repos/sreecha/grpc/subscription","commits_url":"https://api.github.com/repos/sreecha/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/sreecha/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/sreecha/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/sreecha/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/sreecha/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/sreecha/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sreecha/grpc/merges","archive_url":"https://api.github.com/repos/sreecha/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sreecha/grpc/downloads","issues_url":"https://api.github.com/repos/sreecha/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/sreecha/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/sreecha/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/sreecha/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sreecha/grpc/labels{/name}","releases_url":"https://api.github.com/repos/sreecha/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/sreecha/grpc/deployments","created_at":"2015-09-29T16:39:17Z","updated_at":"2018-07-25T21:34:52Z","pushed_at":"2018-07-25T21:34:50Z","git_url":"git://github.com/sreecha/grpc.git","ssh_url":"git@github.com:sreecha/grpc.git","clone_url":"https://github.com/sreecha/grpc.git","svn_url":"https://github.com/sreecha/grpc","homepage":"","size":159622,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"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":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"6a2fbcb4d27243e8c32227b681c38c6221e09a00","user":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729880,"node_id":"MDEwOlJlcG9zaXRvcnkyNzcyOTg4MA==","name":"grpc","full_name":"grpc/grpc","owner":{"login":"grpc","id":7802525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc4MDI1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/7802525?v=4","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc","description":"The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)","fork":false,"url":"https://api.github.com/repos/grpc/grpc","forks_url":"https://api.github.com/repos/grpc/grpc/forks","keys_url":"https://api.github.com/repos/grpc/grpc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc/teams","hooks_url":"https://api.github.com/repos/grpc/grpc/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc/events","assignees_url":"https://api.github.com/repos/grpc/grpc/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc/tags","blobs_url":"https://api.github.com/repos/grpc/grpc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc/subscription","commits_url":"https://api.github.com/repos/grpc/grpc/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc/merges","archive_url":"https://api.github.com/repos/grpc/grpc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc/downloads","issues_url":"https://api.github.com/repos/grpc/grpc/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc/releases{/id}","deployments_url":"https://api.github.com/repos/grpc/grpc/deployments","created_at":"2014-12-08T18:58:53Z","updated_at":"2018-07-27T21:40:30Z","pushed_at":"2018-07-27T21:33:10Z","git_url":"git://github.com/grpc/grpc.git","ssh_url":"git@github.com:grpc/grpc.git","clone_url":"https://github.com/grpc/grpc.git","svn_url":"https://github.com/grpc/grpc","homepage":"https://grpc.io","size":188908,"stargazers_count":16397,"watchers_count":16397,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":3705,"mirror_url":null,"archived":false,"open_issues_count":1013,"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":3705,"open_issues":1013,"watchers":16397,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16081"},"html":{"href":"https://github.com/grpc/grpc/pull/16081"},"issue":{"href":"https://api.github.com/repos/grpc/grpc/issues/16081"},"comments":{"href":"https://api.github.com/repos/grpc/grpc/issues/16081/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16081/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc/pulls/16081/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc/statuses/9bc8ee42c20385214027ced5991b9973a0282655"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sreecha"}}