{"action":"created","issue":{"url":"https://api.github.com/repos/WG21-SG14/SG14/issues/59","repository_url":"https://api.github.com/repos/WG21-SG14/SG14","labels_url":"https://api.github.com/repos/WG21-SG14/SG14/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/WG21-SG14/SG14/issues/59/comments","events_url":"https://api.github.com/repos/WG21-SG14/SG14/issues/59/events","html_url":"https://github.com/WG21-SG14/SG14/issues/59","id":143861712,"number":59,"title":"non thread-safe shared_ptr","user":{"login":"onqtam","id":4648169,"avatar_url":"https://avatars3.githubusercontent.com/u/4648169?v=4","gravatar_id":"","url":"https://api.github.com/users/onqtam","html_url":"https://github.com/onqtam","followers_url":"https://api.github.com/users/onqtam/followers","following_url":"https://api.github.com/users/onqtam/following{/other_user}","gists_url":"https://api.github.com/users/onqtam/gists{/gist_id}","starred_url":"https://api.github.com/users/onqtam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onqtam/subscriptions","organizations_url":"https://api.github.com/users/onqtam/orgs","repos_url":"https://api.github.com/users/onqtam/repos","events_url":"https://api.github.com/users/onqtam/events{/privacy}","received_events_url":"https://api.github.com/users/onqtam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-03-27T23:53:45Z","updated_at":"2018-05-02T08:12:06Z","closed_at":null,"author_association":"NONE","body":"Is there a chance to have a non thread-safe shared_ptr in the standard?\n\nI was thinking either as a new template or maybe the current shared_ptr should have a template parameter if it's ref counting should be atomic.\n\nThere is quite a bit of interest in such a thing - see [here](http://stackoverflow.com/questions/6593770/creating-a-non-thread-safe-shared-ptr)\n\nAndrei Alexandrescu talked at the cppcon how to implement such a pointer yourself but I feel the standard should provide one - see [here](https://www.youtube.com/watch?v=Qq_WaiwzOtI)\n\nIf facebook are doing it - it must be valuable.\n\nCurrently the only publicly available solution seems to be building boost with a flag/define to disable thread-safe reference counting.\n\nIt might be also good to have the optimizations that Andrei talks about - for the common case when the ref count only goes to 1 and then to 0.\n\nI've already asked this in the google groups for the c++ standard/discussions and I was told that I should make a proposal but I'm not gonna go that route myself just yet.\n"},"comment":{"url":"https://api.github.com/repos/WG21-SG14/SG14/issues/comments/385898601","html_url":"https://github.com/WG21-SG14/SG14/issues/59#issuecomment-385898601","issue_url":"https://api.github.com/repos/WG21-SG14/SG14/issues/59","id":385898601,"user":{"login":"ilyapopov","id":1054514,"avatar_url":"https://avatars0.githubusercontent.com/u/1054514?v=4","gravatar_id":"","url":"https://api.github.com/users/ilyapopov","html_url":"https://github.com/ilyapopov","followers_url":"https://api.github.com/users/ilyapopov/followers","following_url":"https://api.github.com/users/ilyapopov/following{/other_user}","gists_url":"https://api.github.com/users/ilyapopov/gists{/gist_id}","starred_url":"https://api.github.com/users/ilyapopov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilyapopov/subscriptions","organizations_url":"https://api.github.com/users/ilyapopov/orgs","repos_url":"https://api.github.com/users/ilyapopov/repos","events_url":"https://api.github.com/users/ilyapopov/events{/privacy}","received_events_url":"https://api.github.com/users/ilyapopov/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T08:12:06Z","updated_at":"2018-05-02T08:12:06Z","author_association":"NONE","body":"> I wonder if this could be done by implementers with the existing shared pointer?\r\nAFAIK, `libstdc++` switches to non-atomic implementation if compiled without `-pthread` flag."}}
{"actor":{"display_login":"ilyapopov"}}