{"action":"opened","number":15585,"pull_request":{"url":"https://api.github.com/repos/mantidproject/mantid/pulls/15585","id":61912722,"html_url":"https://github.com/mantidproject/mantid/pull/15585","diff_url":"https://github.com/mantidproject/mantid/pull/15585.diff","patch_url":"https://github.com/mantidproject/mantid/pull/15585.patch","issue_url":"https://api.github.com/repos/mantidproject/mantid/issues/15585","number":15585,"state":"open","locked":false,"title":"Replace critical region in cow_ptr by std::mutex/lock_guard for better performance","user":{"login":"SimonHeybrock","id":12912489,"avatar_url":"https://avatars.githubusercontent.com/u/12912489?v=3","gravatar_id":"","url":"https://api.github.com/users/SimonHeybrock","html_url":"https://github.com/SimonHeybrock","followers_url":"https://api.github.com/users/SimonHeybrock/followers","following_url":"https://api.github.com/users/SimonHeybrock/following{/other_user}","gists_url":"https://api.github.com/users/SimonHeybrock/gists{/gist_id}","starred_url":"https://api.github.com/users/SimonHeybrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SimonHeybrock/subscriptions","organizations_url":"https://api.github.com/users/SimonHeybrock/orgs","repos_url":"https://api.github.com/users/SimonHeybrock/repos","events_url":"https://api.github.com/users/SimonHeybrock/events{/privacy}","received_events_url":"https://api.github.com/users/SimonHeybrock/received_events","type":"User","site_admin":false},"body":"The class `cow_ptr` is used for the histogram data (`X`, `Y`, and `E`) in our matrix workspaces to provide a copy-on-write mechanism. Before these changes this copy was made thread-safe via a critical region (OpenMP). However, this basically corresponds to a global lock, i.e., if thread 1 copies spectrum 42, thread 2 cannot at the same time copy spectrum 13.\r\nThis PR adds a `std::mutex` variable to `cow_ptr`. The critical region is replaced with a `std::lock_guard` based on this mutex, i.e., we now have a local lock and different sprectra can be copied at the same time.\r\n\r\nThis may potentially yield significant speed-up for algorithms that work with, e.g., `Workspace2D`.\r\n\r\n**To test:**\r\n\r\nCode review.\r\nNo corresponding issue.\r\nThere may be changes to the release note in case we notice a significant speed-up for certain algorithms. I suggest we update the release notes at a later point, once we had a look at our performance tests.\r\n\r\n[Release notes](/docs/source/release/)\r\n<!-- Replace with a link above to the updated file or state \"Does not need to be in the release notes.\" -->\r\n\r\n---\r\n\r\n#### Reviewer ####\r\n\r\nPlease comment on the following ([full description](http://www.mantidproject.org/Individual_Ticket_Testing)):\r\n\r\n##### Code Review #####\r\n\r\n- [ ] Is the code of an acceptable quality?\r\n- [ ] Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?\r\n- [ ] Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?\r\n- [ ] If there are changes in the release notes then do they describe the changes appropriately?\r\n\r\n##### Functional Tests #####\r\n\r\n- [ ] Do changes function as described? Add comments below that describe the tests performed?\r\n- [ ] How do the changes handle unexpected situations, e.g. bad input?\r\n- [ ] Has the relevant documentation been added/updated?\r\n- [ ] Is user-facing documentation written in a user-friendly manner?\r\n- [ ] Has developer documentation been updated if required?\r\n\r\n- Does everything look good? Comment with the ship it emoji but don't merge. A member of `@mantidproject/gatekeepers` will take care of it.\r\n\r\n","created_at":"2016-03-07T12:49:09Z","updated_at":"2016-03-07T12:49:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/5","html_url":"https://github.com/mantidproject/mantid/milestones/Release%203.7","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/5/labels","id":1106939,"number":5,"title":"Release 3.7","description":"","creator":{"login":"peterfpeterson","id":404003,"avatar_url":"https://avatars.githubusercontent.com/u/404003?v=3","gravatar_id":"","url":"https://api.github.com/users/peterfpeterson","html_url":"https://github.com/peterfpeterson","followers_url":"https://api.github.com/users/peterfpeterson/followers","following_url":"https://api.github.com/users/peterfpeterson/following{/other_user}","gists_url":"https://api.github.com/users/peterfpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/peterfpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterfpeterson/subscriptions","organizations_url":"https://api.github.com/users/peterfpeterson/orgs","repos_url":"https://api.github.com/users/peterfpeterson/repos","events_url":"https://api.github.com/users/peterfpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/peterfpeterson/received_events","type":"User","site_admin":false},"open_issues":580,"closed_issues":291,"state":"open","created_at":"2015-05-12T15:38:13Z","updated_at":"2016-03-07T12:49:09Z","due_on":"2016-06-05T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mantidproject/mantid/pulls/15585/commits","review_comments_url":"https://api.github.com/repos/mantidproject/mantid/pulls/15585/comments","review_comment_url":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/15585/comments","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/06d77d833ec8ab8ea1f90389e0b98c8ed27c8f59","head":{"label":"mantidproject:cow_ptr_critical_mutex","ref":"cow_ptr_critical_mutex","sha":"06d77d833ec8ab8ea1f90389e0b98c8ed27c8f59","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2016-02-24T22:44:32Z","pushed_at":"2016-03-07T12:41:44Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":350966,"stargazers_count":38,"watchers_count":38,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":1473,"forks":28,"open_issues":1473,"watchers":38,"default_branch":"master"}},"base":{"label":"mantidproject:master","ref":"master","sha":"d537b369778e84d87ea010821cb8217ac8b00a0d","user":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"repo":{"id":2594116,"name":"mantid","full_name":"mantidproject/mantid","owner":{"login":"mantidproject","id":671496,"avatar_url":"https://avatars.githubusercontent.com/u/671496?v=3","gravatar_id":"","url":"https://api.github.com/users/mantidproject","html_url":"https://github.com/mantidproject","followers_url":"https://api.github.com/users/mantidproject/followers","following_url":"https://api.github.com/users/mantidproject/following{/other_user}","gists_url":"https://api.github.com/users/mantidproject/gists{/gist_id}","starred_url":"https://api.github.com/users/mantidproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mantidproject/subscriptions","organizations_url":"https://api.github.com/users/mantidproject/orgs","repos_url":"https://api.github.com/users/mantidproject/repos","events_url":"https://api.github.com/users/mantidproject/events{/privacy}","received_events_url":"https://api.github.com/users/mantidproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mantidproject/mantid","description":"Main repository for Mantid code","fork":false,"url":"https://api.github.com/repos/mantidproject/mantid","forks_url":"https://api.github.com/repos/mantidproject/mantid/forks","keys_url":"https://api.github.com/repos/mantidproject/mantid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mantidproject/mantid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mantidproject/mantid/teams","hooks_url":"https://api.github.com/repos/mantidproject/mantid/hooks","issue_events_url":"https://api.github.com/repos/mantidproject/mantid/issues/events{/number}","events_url":"https://api.github.com/repos/mantidproject/mantid/events","assignees_url":"https://api.github.com/repos/mantidproject/mantid/assignees{/user}","branches_url":"https://api.github.com/repos/mantidproject/mantid/branches{/branch}","tags_url":"https://api.github.com/repos/mantidproject/mantid/tags","blobs_url":"https://api.github.com/repos/mantidproject/mantid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mantidproject/mantid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mantidproject/mantid/git/refs{/sha}","trees_url":"https://api.github.com/repos/mantidproject/mantid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mantidproject/mantid/statuses/{sha}","languages_url":"https://api.github.com/repos/mantidproject/mantid/languages","stargazers_url":"https://api.github.com/repos/mantidproject/mantid/stargazers","contributors_url":"https://api.github.com/repos/mantidproject/mantid/contributors","subscribers_url":"https://api.github.com/repos/mantidproject/mantid/subscribers","subscription_url":"https://api.github.com/repos/mantidproject/mantid/subscription","commits_url":"https://api.github.com/repos/mantidproject/mantid/commits{/sha}","git_commits_url":"https://api.github.com/repos/mantidproject/mantid/git/commits{/sha}","comments_url":"https://api.github.com/repos/mantidproject/mantid/comments{/number}","issue_comment_url":"https://api.github.com/repos/mantidproject/mantid/issues/comments{/number}","contents_url":"https://api.github.com/repos/mantidproject/mantid/contents/{+path}","compare_url":"https://api.github.com/repos/mantidproject/mantid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mantidproject/mantid/merges","archive_url":"https://api.github.com/repos/mantidproject/mantid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mantidproject/mantid/downloads","issues_url":"https://api.github.com/repos/mantidproject/mantid/issues{/number}","pulls_url":"https://api.github.com/repos/mantidproject/mantid/pulls{/number}","milestones_url":"https://api.github.com/repos/mantidproject/mantid/milestones{/number}","notifications_url":"https://api.github.com/repos/mantidproject/mantid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mantidproject/mantid/labels{/name}","releases_url":"https://api.github.com/repos/mantidproject/mantid/releases{/id}","deployments_url":"https://api.github.com/repos/mantidproject/mantid/deployments","created_at":"2011-10-17T19:07:38Z","updated_at":"2016-02-24T22:44:32Z","pushed_at":"2016-03-07T12:41:44Z","git_url":"git://github.com/mantidproject/mantid.git","ssh_url":"git@github.com:mantidproject/mantid.git","clone_url":"https://github.com/mantidproject/mantid.git","svn_url":"https://github.com/mantidproject/mantid","homepage":"www.mantidproject.org","size":350966,"stargazers_count":38,"watchers_count":38,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":1473,"forks":28,"open_issues":1473,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/15585"},"html":{"href":"https://github.com/mantidproject/mantid/pull/15585"},"issue":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/15585"},"comments":{"href":"https://api.github.com/repos/mantidproject/mantid/issues/15585/comments"},"review_comments":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/15585/comments"},"review_comment":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mantidproject/mantid/pulls/15585/commits"},"statuses":{"href":"https://api.github.com/repos/mantidproject/mantid/statuses/06d77d833ec8ab8ea1f90389e0b98c8ed27c8f59"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":35,"deletions":11,"changed_files":1}}