{"action":"created","comment":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments/40419908","id":40419908,"diff_hunk":"@@ -0,0 +1,356 @@\n+> Quotations are used for notes.\n+\n+> This document is work-in-progress.\n+> Intentions of this effort and document are: to sum up the behavior\n+> of Ruby in concurrent and parallel environment, initiate discussion,\n+> identify problems in the document, find flaws in the Ruby\n+> implementations if any, suggest what has to be enhanced in Ruby itself\n+> and cooperate towards the goal in all implementations (using\n+> `concurrent-ruby` as compatibility layer).\n+\n+# Synchronization\n+\n+This layer provides tools to write concurrent abstractions independent on any\n+particular Ruby implementation. It is build on top of Ruby memory model which is\n+also described here. `concurrent-ruby` abstractions are build using this layer.\n+\n+**Why?** Ruby is great expressive language, but it lacks in support for\n+concurrent and parallel computation. It's hoped that this document will provide\n+ground steps for Ruby to become as good in this area as in others.\n+\n+Without memory model and this layer it's very hard to write concurrent\n+abstractions for Ruby. To write a proper concurrent abstraction it often means\n+to reimplement it more than once for different Ruby runtimes, which is very\n+time-consuming and error-prone.\n+\n+# Ruby memory model\n+\n+Ruby memory model is a framework allowing to reason about programs in concurrent\n+and parallel environment. It allows to identify what is and what is not a [race\n+condition](https://en.wikipedia.org/wiki/Race_condition). Memory model is also a\n+contract: if a program is written without the race conditions it behaves in","path":"doc/synchronization.md","position":31,"original_position":31,"commit_id":"0334cfbf995e05658995d206a81644547d947add","original_commit_id":"0334cfbf995e05658995d206a81644547d947add","user":{"login":"chrisseaton","id":341094,"avatar_url":"https://avatars.githubusercontent.com/u/341094?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisseaton","html_url":"https://github.com/chrisseaton","followers_url":"https://api.github.com/users/chrisseaton/followers","following_url":"https://api.github.com/users/chrisseaton/following{/other_user}","gists_url":"https://api.github.com/users/chrisseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseaton/subscriptions","organizations_url":"https://api.github.com/users/chrisseaton/orgs","repos_url":"https://api.github.com/users/chrisseaton/repos","events_url":"https://api.github.com/users/chrisseaton/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseaton/received_events","type":"User","site_admin":false},"body":"But 'race conditions' does not need an article as it's plural :) So simply 'without race conditions'","created_at":"2015-09-25T11:16:35Z","updated_at":"2015-09-25T11:16:35Z","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422#discussion_r40419908","pull_request_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422","_links":{"self":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments/40419908"},"html":{"href":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422#discussion_r40419908"},"pull_request":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422"}}},"pull_request":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422","id":45949830,"html_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422","diff_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422.diff","patch_url":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422.patch","issue_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/422","number":422,"state":"open","locked":false,"title":"Add documentation for informal Ruby memory model and synchronisation …","user":{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars.githubusercontent.com/u/204460?v=3","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},"body":"…extensions.","created_at":"2015-09-24T21:05:38Z","updated_at":"2015-09-25T11:16:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58fd0f77239a1f8f113e7b9aec87597a4ad44673","assignee":{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars.githubusercontent.com/u/204460?v=3","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/milestones/8","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/milestones/1.0.0%20Release","labels_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/milestones/8/labels","id":846255,"number":8,"title":"1.0.0 Release","description":"See #257 ","creator":{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars.githubusercontent.com/u/204460?v=3","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":22,"state":"open","created_at":"2014-10-30T08:00:45Z","updated_at":"2015-09-25T08:41:10Z","due_on":"2015-11-15T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422/commits","review_comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422/comments","review_comment_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/422/comments","statuses_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/0334cfbf995e05658995d206a81644547d947add","head":{"label":"pitr-ch:synchronization-mm","ref":"synchronization-mm","sha":"0334cfbf995e05658995d206a81644547d947add","user":{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars.githubusercontent.com/u/204460?v=3","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},"repo":{"id":19456802,"name":"concurrent-ruby","full_name":"pitr-ch/concurrent-ruby","owner":{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars.githubusercontent.com/u/204460?v=3","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pitr-ch/concurrent-ruby","description":"Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.","fork":true,"url":"https://api.github.com/repos/pitr-ch/concurrent-ruby","forks_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/forks","keys_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/teams","hooks_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/hooks","issue_events_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/events","assignees_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/tags","blobs_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/languages","stargazers_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/stargazers","contributors_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/contributors","subscribers_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/subscribers","subscription_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/subscription","commits_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/merges","archive_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/downloads","issues_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/labels{/name}","releases_url":"https://api.github.com/repos/pitr-ch/concurrent-ruby/releases{/id}","created_at":"2014-05-05T13:34:05Z","updated_at":"2014-12-28T11:09:26Z","pushed_at":"2015-09-24T21:22:18Z","git_url":"git://github.com/pitr-ch/concurrent-ruby.git","ssh_url":"git@github.com:pitr-ch/concurrent-ruby.git","clone_url":"https://github.com/pitr-ch/concurrent-ruby.git","svn_url":"https://github.com/pitr-ch/concurrent-ruby","homepage":"http://www.concurrent-ruby.com","size":7099,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"ruby-concurrency:synchronization","ref":"synchronization","sha":"3f56ea085514dafd362c732d31ce4232ac67810a","user":{"login":"ruby-concurrency","id":5462766,"avatar_url":"https://avatars.githubusercontent.com/u/5462766?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-concurrency","html_url":"https://github.com/ruby-concurrency","followers_url":"https://api.github.com/users/ruby-concurrency/followers","following_url":"https://api.github.com/users/ruby-concurrency/following{/other_user}","gists_url":"https://api.github.com/users/ruby-concurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-concurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-concurrency/subscriptions","organizations_url":"https://api.github.com/users/ruby-concurrency/orgs","repos_url":"https://api.github.com/users/ruby-concurrency/repos","events_url":"https://api.github.com/users/ruby-concurrency/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-concurrency/received_events","type":"Organization","site_admin":false},"repo":{"id":11607598,"name":"concurrent-ruby","full_name":"ruby-concurrency/concurrent-ruby","owner":{"login":"ruby-concurrency","id":5462766,"avatar_url":"https://avatars.githubusercontent.com/u/5462766?v=3","gravatar_id":"","url":"https://api.github.com/users/ruby-concurrency","html_url":"https://github.com/ruby-concurrency","followers_url":"https://api.github.com/users/ruby-concurrency/followers","following_url":"https://api.github.com/users/ruby-concurrency/following{/other_user}","gists_url":"https://api.github.com/users/ruby-concurrency/gists{/gist_id}","starred_url":"https://api.github.com/users/ruby-concurrency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruby-concurrency/subscriptions","organizations_url":"https://api.github.com/users/ruby-concurrency/orgs","repos_url":"https://api.github.com/users/ruby-concurrency/repos","events_url":"https://api.github.com/users/ruby-concurrency/events{/privacy}","received_events_url":"https://api.github.com/users/ruby-concurrency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ruby-concurrency/concurrent-ruby","description":"Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.","fork":false,"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby","forks_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/forks","keys_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/teams","hooks_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/hooks","issue_events_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/events","assignees_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/tags","blobs_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/languages","stargazers_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/stargazers","contributors_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/contributors","subscribers_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/subscribers","subscription_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/subscription","commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/merges","archive_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/downloads","issues_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/labels{/name}","releases_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/releases{/id}","created_at":"2013-07-23T12:19:51Z","updated_at":"2015-09-24T21:02:36Z","pushed_at":"2015-09-25T09:40:15Z","git_url":"git://github.com/ruby-concurrency/concurrent-ruby.git","ssh_url":"git@github.com:ruby-concurrency/concurrent-ruby.git","clone_url":"https://github.com/ruby-concurrency/concurrent-ruby.git","svn_url":"https://github.com/ruby-concurrency/concurrent-ruby","homepage":"http://www.concurrent-ruby.com","size":17998,"stargazers_count":1642,"watchers_count":1642,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":89,"mirror_url":null,"open_issues_count":28,"forks":89,"open_issues":28,"watchers":1642,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422"},"html":{"href":"https://github.com/ruby-concurrency/concurrent-ruby/pull/422"},"issue":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/422"},"comments":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/422/comments"},"review_comments":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422/comments"},"review_comment":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/pulls/422/commits"},"statuses":{"href":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/statuses/0334cfbf995e05658995d206a81644547d947add"}}}}