{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/45085","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/45085/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/45085/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/45085/events","html_url":"https://github.com/rust-lang/rust/issues/45085","id":263647939,"number":45085,"title":"Consider adding load/store atomics for targets that don't support compare and swap","user":{"login":"parched","id":5975405,"avatar_url":"https://avatars1.githubusercontent.com/u/5975405?v=4","gravatar_id":"","url":"https://api.github.com/users/parched","html_url":"https://github.com/parched","followers_url":"https://api.github.com/users/parched/followers","following_url":"https://api.github.com/users/parched/following{/other_user}","gists_url":"https://api.github.com/users/parched/gists{/gist_id}","starred_url":"https://api.github.com/users/parched/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parched/subscriptions","organizations_url":"https://api.github.com/users/parched/orgs","repos_url":"https://api.github.com/users/parched/repos","events_url":"https://api.github.com/users/parched/events{/privacy}","received_events_url":"https://api.github.com/users/parched/received_events","type":"User","site_admin":false},"labels":[{"id":630652267,"url":"https://api.github.com/repos/rust-lang/rust/labels/C-feature-request","name":"C-feature-request","color":"f5f1fd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-10-07T15:11:10Z","updated_at":"2018-04-27T18:36:15Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Some targets, Armv6-M for example, don't support atomic compare and swap so have \"max-atomic-width\" set to 0 in their target specs. Often you just need to `AtomicUsize::load` and `AtomicUsize::store` and none of the other CAS dependent methods but unfortunately it's not supported by rust even if that targets natively support it.\r\n\r\nWe could add another field to the target spec, \"max-atomic-load-store-width\", that defaults to the same value as \"max-atomic-width\", for determining whether to enable `Atomic*` without the CAS dependent methods.\r\n\r\ncc @japaric who probably would like this for https://github.com/japaric/spscrb"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/385057644","html_url":"https://github.com/rust-lang/rust/issues/45085#issuecomment-385057644","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/45085","id":385057644,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars1.githubusercontent.com/u/64996?v=4","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T18:36:15Z","updated_at":"2018-04-27T18:36:15Z","author_association":"OWNER","body":"@japaric your proposal sounds great to me! I think we'd totally be down for providing stripped-down `Atomic*` types. I didn't actually realize that there was a difference between an atomic load and a volatile load personally!\r\n\r\nI think from a stabilization perspective we're all good here as well, it's \"no worse\" than the situation today and all the appropriate bits will continue to be unstable.\r\n\r\nFWIW on wasm we actually emit atomic instructions and all to LLVM, but we also tell LLVM that wasm is [single threaded](https://github.com/rust-lang/rust/blob/71d3dac4a86d192c2c80948621859da3b363fa50/src/librustc_target/spec/wasm32_unknown_unknown.rs#L47-L49) which causes it to legalize atomics to nonatomic operations. (aka that's why atomics work on wasm)"}}
{"actor":{"display_login":"alexcrichton"}}