{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/45936880","id":45936880,"diff_hunk":"@@ -0,0 +1,179 @@\n+/*\n+ * Copyright 2015 Facebook, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+// @author Bo Hu (bhu@fb.com)\n+// @author Jordan DeLong (delong.j@fb.com)\n+// @author shawn chen(chen.xiaowei@h3c.com)\n+\n+#ifndef PRODUCER_CONSUMER_QUEUE_H_\n+#define PRODUCER_CONSUMER_QUEUE_H_\n+\n+#include <atomic>\n+#include \"include/assert.h\"\n+\n+#include <cstdlib>\n+#include <stdexcept>\n+#include <type_traits>\n+#include <utility>\n+\n+namespace folly {\n+\n+/*\n+ * ProducerConsumerQueue is a one producer and one consumer queue\n+ * without locks.\n+ */","path":"src/common/ProducerConsumerQueue.h","position":36,"original_position":36,"commit_id":"2c8057066bfd81a559e37e9b306487f0624bb139","original_commit_id":"2c8057066bfd81a559e37e9b306487f0624bb139","user":{"login":"cxwshawn","id":4486102,"avatar_url":"https://avatars.githubusercontent.com/u/4486102?v=3","gravatar_id":"","url":"https://api.github.com/users/cxwshawn","html_url":"https://github.com/cxwshawn","followers_url":"https://api.github.com/users/cxwshawn/followers","following_url":"https://api.github.com/users/cxwshawn/following{/other_user}","gists_url":"https://api.github.com/users/cxwshawn/gists{/gist_id}","starred_url":"https://api.github.com/users/cxwshawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxwshawn/subscriptions","organizations_url":"https://api.github.com/users/cxwshawn/orgs","repos_url":"https://api.github.com/users/cxwshawn/repos","events_url":"https://api.github.com/users/cxwshawn/events{/privacy}","received_events_url":"https://api.github.com/users/cxwshawn/received_events","type":"User","site_admin":false},"body":"@yuyuyu101 actually, multi-producer & multi consumer cannot really eliminate the lock, so I think this is enough .","created_at":"2015-11-26T01:27:48Z","updated_at":"2015-11-26T01:27:48Z","html_url":"https://github.com/ceph/ceph/pull/6676#discussion_r45936880","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/6676","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/45936880"},"html":{"href":"https://github.com/ceph/ceph/pull/6676#discussion_r45936880"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6676"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/6676","id":51487478,"html_url":"https://github.com/ceph/ceph/pull/6676","diff_url":"https://github.com/ceph/ceph/pull/6676.diff","patch_url":"https://github.com/ceph/ceph/pull/6676.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/6676","number":6676,"state":"open","locked":false,"title":"filejournal: optimize writeq_lock by using lockerfree queue.","user":{"login":"cxwshawn","id":4486102,"avatar_url":"https://avatars.githubusercontent.com/u/4486102?v=3","gravatar_id":"","url":"https://api.github.com/users/cxwshawn","html_url":"https://github.com/cxwshawn","followers_url":"https://api.github.com/users/cxwshawn/followers","following_url":"https://api.github.com/users/cxwshawn/following{/other_user}","gists_url":"https://api.github.com/users/cxwshawn/gists{/gist_id}","starred_url":"https://api.github.com/users/cxwshawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxwshawn/subscriptions","organizations_url":"https://api.github.com/users/cxwshawn/orgs","repos_url":"https://api.github.com/users/cxwshawn/repos","events_url":"https://api.github.com/users/cxwshawn/events{/privacy}","received_events_url":"https://api.github.com/users/cxwshawn/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Xiaowei Chen <chen.xiaowei@h3c.com>","created_at":"2015-11-23T04:36:12Z","updated_at":"2015-11-26T01:27:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4207aa9b2690c8520955426693d261365faeb79d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/6676/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/6676/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/6676/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/2c8057066bfd81a559e37e9b306487f0624bb139","head":{"label":"cxwshawn:wip-perf-fix","ref":"wip-perf-fix","sha":"2c8057066bfd81a559e37e9b306487f0624bb139","user":{"login":"cxwshawn","id":4486102,"avatar_url":"https://avatars.githubusercontent.com/u/4486102?v=3","gravatar_id":"","url":"https://api.github.com/users/cxwshawn","html_url":"https://github.com/cxwshawn","followers_url":"https://api.github.com/users/cxwshawn/followers","following_url":"https://api.github.com/users/cxwshawn/following{/other_user}","gists_url":"https://api.github.com/users/cxwshawn/gists{/gist_id}","starred_url":"https://api.github.com/users/cxwshawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxwshawn/subscriptions","organizations_url":"https://api.github.com/users/cxwshawn/orgs","repos_url":"https://api.github.com/users/cxwshawn/repos","events_url":"https://api.github.com/users/cxwshawn/events{/privacy}","received_events_url":"https://api.github.com/users/cxwshawn/received_events","type":"User","site_admin":false},"repo":{"id":38021156,"name":"ceph","full_name":"cxwshawn/ceph","owner":{"login":"cxwshawn","id":4486102,"avatar_url":"https://avatars.githubusercontent.com/u/4486102?v=3","gravatar_id":"","url":"https://api.github.com/users/cxwshawn","html_url":"https://github.com/cxwshawn","followers_url":"https://api.github.com/users/cxwshawn/followers","following_url":"https://api.github.com/users/cxwshawn/following{/other_user}","gists_url":"https://api.github.com/users/cxwshawn/gists{/gist_id}","starred_url":"https://api.github.com/users/cxwshawn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxwshawn/subscriptions","organizations_url":"https://api.github.com/users/cxwshawn/orgs","repos_url":"https://api.github.com/users/cxwshawn/repos","events_url":"https://api.github.com/users/cxwshawn/events{/privacy}","received_events_url":"https://api.github.com/users/cxwshawn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cxwshawn/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/cxwshawn/ceph","forks_url":"https://api.github.com/repos/cxwshawn/ceph/forks","keys_url":"https://api.github.com/repos/cxwshawn/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cxwshawn/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cxwshawn/ceph/teams","hooks_url":"https://api.github.com/repos/cxwshawn/ceph/hooks","issue_events_url":"https://api.github.com/repos/cxwshawn/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/cxwshawn/ceph/events","assignees_url":"https://api.github.com/repos/cxwshawn/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/cxwshawn/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/cxwshawn/ceph/tags","blobs_url":"https://api.github.com/repos/cxwshawn/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cxwshawn/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cxwshawn/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/cxwshawn/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cxwshawn/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/cxwshawn/ceph/languages","stargazers_url":"https://api.github.com/repos/cxwshawn/ceph/stargazers","contributors_url":"https://api.github.com/repos/cxwshawn/ceph/contributors","subscribers_url":"https://api.github.com/repos/cxwshawn/ceph/subscribers","subscription_url":"https://api.github.com/repos/cxwshawn/ceph/subscription","commits_url":"https://api.github.com/repos/cxwshawn/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/cxwshawn/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/cxwshawn/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/cxwshawn/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/cxwshawn/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/cxwshawn/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cxwshawn/ceph/merges","archive_url":"https://api.github.com/repos/cxwshawn/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cxwshawn/ceph/downloads","issues_url":"https://api.github.com/repos/cxwshawn/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/cxwshawn/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/cxwshawn/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/cxwshawn/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cxwshawn/ceph/labels{/name}","releases_url":"https://api.github.com/repos/cxwshawn/ceph/releases{/id}","created_at":"2015-06-25T01:38:43Z","updated_at":"2015-06-25T01:38:57Z","pushed_at":"2015-11-25T09:42:33Z","git_url":"git://github.com/cxwshawn/ceph.git","ssh_url":"git@github.com:cxwshawn/ceph.git","clone_url":"https://github.com/cxwshawn/ceph.git","svn_url":"https://github.com/cxwshawn/ceph","homepage":"http://ceph.com","size":141421,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"ba5f45a7a4d9d3d2b3fc6f214e76df082f3f92f3","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","created_at":"2011-09-01T21:41:26Z","updated_at":"2015-11-25T06:55:52Z","pushed_at":"2015-11-26T01:19:48Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":168703,"stargazers_count":1682,"watchers_count":1682,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":997,"mirror_url":null,"open_issues_count":254,"forks":997,"open_issues":254,"watchers":1682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6676"},"html":{"href":"https://github.com/ceph/ceph/pull/6676"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/6676"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/6676/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6676/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/6676/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/2c8057066bfd81a559e37e9b306487f0624bb139"}}}}