{"action":"closed","number":747,"pull_request":{"url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747","id":10243800,"html_url":"https://github.com/OpenImageIO/oiio/pull/747","diff_url":"https://github.com/OpenImageIO/oiio/pull/747.diff","patch_url":"https://github.com/OpenImageIO/oiio/pull/747.patch","issue_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/747","number":747,"state":"closed","locked":false,"title":"C++11 implementation for thread.h","user":{"login":"gchatelet","id":149665,"avatar_url":"https://avatars.githubusercontent.com/u/149665?v=3","gravatar_id":"","url":"https://api.github.com/users/gchatelet","html_url":"https://github.com/gchatelet","followers_url":"https://api.github.com/users/gchatelet/followers","following_url":"https://api.github.com/users/gchatelet/following{/other_user}","gists_url":"https://api.github.com/users/gchatelet/gists{/gist_id}","starred_url":"https://api.github.com/users/gchatelet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchatelet/subscriptions","organizations_url":"https://api.github.com/users/gchatelet/orgs","repos_url":"https://api.github.com/users/gchatelet/repos","events_url":"https://api.github.com/users/gchatelet/events{/privacy}","received_events_url":"https://api.github.com/users/gchatelet/received_events","type":"User","site_admin":false},"body":"A proposal to use C++11 atomics when available.\n\nSome before/after comparisons on my quad-core machine (Arch Linux x86-64).\nCompiler used : Clang 3.3 and GCC 4.8.2\n\nMore tests need to be done especially for other platforms and many processors motherboards.\n\n```\natomic_test --threads 12 --trials 2 --wedge;\n               Clang          GCC            Clang          GCC\nthreads        baseline       baseline       C++11          C++11 \n1              3.9            3.9            3.9            3.9\n2              13.2           13.5           13             13.2\n4              14.7           14.9           14.6           14.4\n8              14.7           14.7           14.8           14.7\n12             14.8           15             14.8           14.5\n```\n\nNo noticeable impact for atomics.\n\n```\nspinlock_test --threads 12 --trials 10 --wedge;\n               Clang          GCC            Clang          GCC\nthreads        baseline       baseline       C++11          C++11 \n1              0.5            0.5            0.6            0.6\n2              0.7            0.7            0.7            0.7\n4              1.1            1.4            1.4            1.5\n8              1.4            1.4            1.7            1.8\n12             1.4            1.3            1.7            1.7\n```\n\nSpinlock seems to be a bit slower under high contention (here hw_threads=4), I'm not sure I can make it as fast as the original within defined behaviour. Also a benchmark on a better machine would make much more sense.\n\n```\nspin_rw_test --threads 12 --trials 5 --wedge --rwratio 99\n               Clang          GCC            Clang          GCC\nthreads        baseline       baseline       C++11          C++11 \n1              0.6            0.8            0.6            0.8\n2              1.5            1.5            0.7            1.4\n4              3              3.9            3.1            3.5\n8              3.3            3.1            2.8            3.2\n12             3.3            2.9            2.7            3\n```\n\nClang with C++11 implementation seems to be consistently the fastest in this test, and GCC seems to be slower overall.\n\nThis patch also fixes a few other issues triggered by this proposal.\n\nGCC with c++11 seems to trigger new warnings (had to add `-Wno-unused-local-typedefs` and deactivate warning as errors)\n","created_at":"2013-11-24T18:44:42Z","updated_at":"2016-12-10T08:55:32Z","closed_at":"2016-12-10T08:55:32Z","merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747/commits","review_comments_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747/comments","review_comment_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/747/comments","statuses_url":"https://api.github.com/repos/OpenImageIO/oiio/statuses/8a557c9dca4223019b774febd2cd242057b9444c","head":{"label":"gchatelet:gchatelet-thread","ref":"gchatelet-thread","sha":"8a557c9dca4223019b774febd2cd242057b9444c","user":{"login":"gchatelet","id":149665,"avatar_url":"https://avatars.githubusercontent.com/u/149665?v=3","gravatar_id":"","url":"https://api.github.com/users/gchatelet","html_url":"https://github.com/gchatelet","followers_url":"https://api.github.com/users/gchatelet/followers","following_url":"https://api.github.com/users/gchatelet/following{/other_user}","gists_url":"https://api.github.com/users/gchatelet/gists{/gist_id}","starred_url":"https://api.github.com/users/gchatelet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gchatelet/subscriptions","organizations_url":"https://api.github.com/users/gchatelet/orgs","repos_url":"https://api.github.com/users/gchatelet/repos","events_url":"https://api.github.com/users/gchatelet/events{/privacy}","received_events_url":"https://api.github.com/users/gchatelet/received_events","type":"User","site_admin":false},"repo":null},"base":{"label":"OpenImageIO:master","ref":"master","sha":"c81f5887035930671d14744985922df87b48d782","user":{"login":"OpenImageIO","id":547887,"avatar_url":"https://avatars.githubusercontent.com/u/547887?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenImageIO","html_url":"https://github.com/OpenImageIO","followers_url":"https://api.github.com/users/OpenImageIO/followers","following_url":"https://api.github.com/users/OpenImageIO/following{/other_user}","gists_url":"https://api.github.com/users/OpenImageIO/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenImageIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenImageIO/subscriptions","organizations_url":"https://api.github.com/users/OpenImageIO/orgs","repos_url":"https://api.github.com/users/OpenImageIO/repos","events_url":"https://api.github.com/users/OpenImageIO/events{/privacy}","received_events_url":"https://api.github.com/users/OpenImageIO/received_events","type":"Organization","site_admin":false},"repo":{"id":1322284,"name":"oiio","full_name":"OpenImageIO/oiio","owner":{"login":"OpenImageIO","id":547887,"avatar_url":"https://avatars.githubusercontent.com/u/547887?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenImageIO","html_url":"https://github.com/OpenImageIO","followers_url":"https://api.github.com/users/OpenImageIO/followers","following_url":"https://api.github.com/users/OpenImageIO/following{/other_user}","gists_url":"https://api.github.com/users/OpenImageIO/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenImageIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenImageIO/subscriptions","organizations_url":"https://api.github.com/users/OpenImageIO/orgs","repos_url":"https://api.github.com/users/OpenImageIO/repos","events_url":"https://api.github.com/users/OpenImageIO/events{/privacy}","received_events_url":"https://api.github.com/users/OpenImageIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenImageIO/oiio","description":"OpenImageIO","fork":false,"url":"https://api.github.com/repos/OpenImageIO/oiio","forks_url":"https://api.github.com/repos/OpenImageIO/oiio/forks","keys_url":"https://api.github.com/repos/OpenImageIO/oiio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenImageIO/oiio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenImageIO/oiio/teams","hooks_url":"https://api.github.com/repos/OpenImageIO/oiio/hooks","issue_events_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/events{/number}","events_url":"https://api.github.com/repos/OpenImageIO/oiio/events","assignees_url":"https://api.github.com/repos/OpenImageIO/oiio/assignees{/user}","branches_url":"https://api.github.com/repos/OpenImageIO/oiio/branches{/branch}","tags_url":"https://api.github.com/repos/OpenImageIO/oiio/tags","blobs_url":"https://api.github.com/repos/OpenImageIO/oiio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenImageIO/oiio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenImageIO/oiio/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenImageIO/oiio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenImageIO/oiio/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenImageIO/oiio/languages","stargazers_url":"https://api.github.com/repos/OpenImageIO/oiio/stargazers","contributors_url":"https://api.github.com/repos/OpenImageIO/oiio/contributors","subscribers_url":"https://api.github.com/repos/OpenImageIO/oiio/subscribers","subscription_url":"https://api.github.com/repos/OpenImageIO/oiio/subscription","commits_url":"https://api.github.com/repos/OpenImageIO/oiio/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenImageIO/oiio/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenImageIO/oiio/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenImageIO/oiio/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenImageIO/oiio/contents/{+path}","compare_url":"https://api.github.com/repos/OpenImageIO/oiio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenImageIO/oiio/merges","archive_url":"https://api.github.com/repos/OpenImageIO/oiio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenImageIO/oiio/downloads","issues_url":"https://api.github.com/repos/OpenImageIO/oiio/issues{/number}","pulls_url":"https://api.github.com/repos/OpenImageIO/oiio/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenImageIO/oiio/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenImageIO/oiio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenImageIO/oiio/labels{/name}","releases_url":"https://api.github.com/repos/OpenImageIO/oiio/releases{/id}","deployments_url":"https://api.github.com/repos/OpenImageIO/oiio/deployments","created_at":"2011-02-02T23:03:28Z","updated_at":"2016-12-08T16:31:17Z","pushed_at":"2016-12-10T08:51:19Z","git_url":"git://github.com/OpenImageIO/oiio.git","ssh_url":"git@github.com:OpenImageIO/oiio.git","clone_url":"https://github.com/OpenImageIO/oiio.git","svn_url":"https://github.com/OpenImageIO/oiio","homepage":"http://www.openimageio.org","size":140869,"stargazers_count":494,"watchers_count":494,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":242,"mirror_url":null,"open_issues_count":88,"forks":242,"open_issues":88,"watchers":494,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747"},"html":{"href":"https://github.com/OpenImageIO/oiio/pull/747"},"issue":{"href":"https://api.github.com/repos/OpenImageIO/oiio/issues/747"},"comments":{"href":"https://api.github.com/repos/OpenImageIO/oiio/issues/747/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenImageIO/oiio/pulls/747/commits"},"statuses":{"href":"https://api.github.com/repos/OpenImageIO/oiio/statuses/8a557c9dca4223019b774febd2cd242057b9444c"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":4,"review_comments":12,"commits":10,"additions":145,"deletions":74,"changed_files":9}}
{"actor":{"display_login":"lgritz"}}