{"action":"opened","number":2433,"pull_request":{"url":"https://api.github.com/repos/mono/mono/pulls/2433","id":55981308,"html_url":"https://github.com/mono/mono/pull/2433","diff_url":"https://github.com/mono/mono/pull/2433.diff","patch_url":"https://github.com/mono/mono/pull/2433.patch","issue_url":"https://api.github.com/repos/mono/mono/issues/2433","number":2433,"state":"open","locked":false,"title":"[runtime] Make VolatileRead/VolatileWrite semantics compatible with MS.NET.","user":{"login":"alexrp","id":44076,"avatar_url":"https://avatars.githubusercontent.com/u/44076?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrp","html_url":"https://github.com/alexrp","followers_url":"https://api.github.com/users/alexrp/followers","following_url":"https://api.github.com/users/alexrp/following{/other_user}","gists_url":"https://api.github.com/users/alexrp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrp/subscriptions","organizations_url":"https://api.github.com/users/alexrp/orgs","repos_url":"https://api.github.com/users/alexrp/repos","events_url":"https://api.github.com/users/alexrp/events{/privacy}","received_events_url":"https://api.github.com/users/alexrp/received_events","type":"User","site_admin":false},"body":"This changes our implementation of `Thread.VolatileRead ()` and `Thread.VolatileWrite ()` to be compatible with MS.NET in that we use full memory barriers instead of acquire/release barriers (even though the latter is sufficient to be spec-compliant).\r\n\r\nI propose this change because we've been importing huge amounts of reference source code over the past year and this trend will probably continue. I don't know that we generally audit reference source code for being compatible with our implementation of these methods. We would have to check every single use of `volatile` variables. This seems rather laborious as these are used *all over the place* in the reference source code.\r\n\r\nThere's also the problem that any amount of user code in the wild could be relying on these methods to have the semantics that they do on MS.NET. Such code could break in subtle ways regardless of our reference source import effort. It could also break *because* of our reference source importing because uses of `volatile` have visible effects outside of the framework code in many cases (though it's of course arguable whether users should be relying on it, ever).\r\n\r\nI'm not a huge fan of doing this as it does make these methods have a (slightly) worse effect on performance of surrounding code. I think it'll save us and our users a lot of headaches, though. It's also worth mentioning that the recommended methods to use these days are the ones on `System.Threading.Volatile` which actually make sense and which are unaffected by this change.","created_at":"2016-01-14T01:23:35Z","updated_at":"2016-01-14T01:23:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f64ae5e83acfd60c32a07b20ac5b8725ccfd43c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mono/mono/pulls/2433/commits","review_comments_url":"https://api.github.com/repos/mono/mono/pulls/2433/comments","review_comment_url":"https://api.github.com/repos/mono/mono/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mono/mono/issues/2433/comments","statuses_url":"https://api.github.com/repos/mono/mono/statuses/e0f17122d5bafa6c0125af468eab46937010206a","head":{"label":"alexrp:thread-volatile-semantics","ref":"thread-volatile-semantics","sha":"e0f17122d5bafa6c0125af468eab46937010206a","user":{"login":"alexrp","id":44076,"avatar_url":"https://avatars.githubusercontent.com/u/44076?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrp","html_url":"https://github.com/alexrp","followers_url":"https://api.github.com/users/alexrp/followers","following_url":"https://api.github.com/users/alexrp/following{/other_user}","gists_url":"https://api.github.com/users/alexrp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrp/subscriptions","organizations_url":"https://api.github.com/users/alexrp/orgs","repos_url":"https://api.github.com/users/alexrp/repos","events_url":"https://api.github.com/users/alexrp/events{/privacy}","received_events_url":"https://api.github.com/users/alexrp/received_events","type":"User","site_admin":false},"repo":{"id":1155583,"name":"mono","full_name":"alexrp/mono","owner":{"login":"alexrp","id":44076,"avatar_url":"https://avatars.githubusercontent.com/u/44076?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrp","html_url":"https://github.com/alexrp","followers_url":"https://api.github.com/users/alexrp/followers","following_url":"https://api.github.com/users/alexrp/following{/other_user}","gists_url":"https://api.github.com/users/alexrp/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrp/subscriptions","organizations_url":"https://api.github.com/users/alexrp/orgs","repos_url":"https://api.github.com/users/alexrp/repos","events_url":"https://api.github.com/users/alexrp/events{/privacy}","received_events_url":"https://api.github.com/users/alexrp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexrp/mono","description":"My contributions to Mono.","fork":true,"url":"https://api.github.com/repos/alexrp/mono","forks_url":"https://api.github.com/repos/alexrp/mono/forks","keys_url":"https://api.github.com/repos/alexrp/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexrp/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexrp/mono/teams","hooks_url":"https://api.github.com/repos/alexrp/mono/hooks","issue_events_url":"https://api.github.com/repos/alexrp/mono/issues/events{/number}","events_url":"https://api.github.com/repos/alexrp/mono/events","assignees_url":"https://api.github.com/repos/alexrp/mono/assignees{/user}","branches_url":"https://api.github.com/repos/alexrp/mono/branches{/branch}","tags_url":"https://api.github.com/repos/alexrp/mono/tags","blobs_url":"https://api.github.com/repos/alexrp/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexrp/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexrp/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexrp/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexrp/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/alexrp/mono/languages","stargazers_url":"https://api.github.com/repos/alexrp/mono/stargazers","contributors_url":"https://api.github.com/repos/alexrp/mono/contributors","subscribers_url":"https://api.github.com/repos/alexrp/mono/subscribers","subscription_url":"https://api.github.com/repos/alexrp/mono/subscription","commits_url":"https://api.github.com/repos/alexrp/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexrp/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexrp/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexrp/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexrp/mono/contents/{+path}","compare_url":"https://api.github.com/repos/alexrp/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexrp/mono/merges","archive_url":"https://api.github.com/repos/alexrp/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexrp/mono/downloads","issues_url":"https://api.github.com/repos/alexrp/mono/issues{/number}","pulls_url":"https://api.github.com/repos/alexrp/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/alexrp/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/alexrp/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexrp/mono/labels{/name}","releases_url":"https://api.github.com/repos/alexrp/mono/releases{/id}","created_at":"2010-12-10T07:59:15Z","updated_at":"2015-05-08T09:05:58Z","pushed_at":"2016-01-14T01:10:28Z","git_url":"git://github.com/alexrp/mono.git","ssh_url":"git@github.com:alexrp/mono.git","clone_url":"https://github.com/alexrp/mono.git","svn_url":"https://github.com/alexrp/mono","homepage":"http://www.mono-project.com/","size":356818,"stargazers_count":11,"watchers_count":11,"language":"C#","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":11,"default_branch":"master"}},"base":{"label":"mono:master","ref":"master","sha":"8051b58749948ced2cba3c560823b679c1562cde","user":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"repo":{"id":791611,"name":"mono","full_name":"mono/mono","owner":{"login":"mono","id":53395,"avatar_url":"https://avatars.githubusercontent.com/u/53395?v=3","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mono/mono","description":"Mono open source ECMA CLI, C# and .NET implementation.","fork":false,"url":"https://api.github.com/repos/mono/mono","forks_url":"https://api.github.com/repos/mono/mono/forks","keys_url":"https://api.github.com/repos/mono/mono/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mono/mono/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mono/mono/teams","hooks_url":"https://api.github.com/repos/mono/mono/hooks","issue_events_url":"https://api.github.com/repos/mono/mono/issues/events{/number}","events_url":"https://api.github.com/repos/mono/mono/events","assignees_url":"https://api.github.com/repos/mono/mono/assignees{/user}","branches_url":"https://api.github.com/repos/mono/mono/branches{/branch}","tags_url":"https://api.github.com/repos/mono/mono/tags","blobs_url":"https://api.github.com/repos/mono/mono/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mono/mono/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mono/mono/git/refs{/sha}","trees_url":"https://api.github.com/repos/mono/mono/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mono/mono/statuses/{sha}","languages_url":"https://api.github.com/repos/mono/mono/languages","stargazers_url":"https://api.github.com/repos/mono/mono/stargazers","contributors_url":"https://api.github.com/repos/mono/mono/contributors","subscribers_url":"https://api.github.com/repos/mono/mono/subscribers","subscription_url":"https://api.github.com/repos/mono/mono/subscription","commits_url":"https://api.github.com/repos/mono/mono/commits{/sha}","git_commits_url":"https://api.github.com/repos/mono/mono/git/commits{/sha}","comments_url":"https://api.github.com/repos/mono/mono/comments{/number}","issue_comment_url":"https://api.github.com/repos/mono/mono/issues/comments{/number}","contents_url":"https://api.github.com/repos/mono/mono/contents/{+path}","compare_url":"https://api.github.com/repos/mono/mono/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mono/mono/merges","archive_url":"https://api.github.com/repos/mono/mono/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mono/mono/downloads","issues_url":"https://api.github.com/repos/mono/mono/issues{/number}","pulls_url":"https://api.github.com/repos/mono/mono/pulls{/number}","milestones_url":"https://api.github.com/repos/mono/mono/milestones{/number}","notifications_url":"https://api.github.com/repos/mono/mono/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mono/mono/labels{/name}","releases_url":"https://api.github.com/repos/mono/mono/releases{/id}","created_at":"2010-07-22T18:06:36Z","updated_at":"2016-01-13T20:31:06Z","pushed_at":"2016-01-14T01:23:35Z","git_url":"git://github.com/mono/mono.git","ssh_url":"git@github.com:mono/mono.git","clone_url":"https://github.com/mono/mono.git","svn_url":"https://github.com/mono/mono","homepage":"http://www.mono-project.com/","size":443930,"stargazers_count":4201,"watchers_count":4201,"language":"C#","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2056,"mirror_url":null,"open_issues_count":126,"forks":2056,"open_issues":126,"watchers":4201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mono/mono/pulls/2433"},"html":{"href":"https://github.com/mono/mono/pull/2433"},"issue":{"href":"https://api.github.com/repos/mono/mono/issues/2433"},"comments":{"href":"https://api.github.com/repos/mono/mono/issues/2433/comments"},"review_comments":{"href":"https://api.github.com/repos/mono/mono/pulls/2433/comments"},"review_comment":{"href":"https://api.github.com/repos/mono/mono/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mono/mono/pulls/2433/commits"},"statuses":{"href":"https://api.github.com/repos/mono/mono/statuses/e0f17122d5bafa6c0125af468eab46937010206a"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":34,"deletions":26,"changed_files":2}}