Skip to content

Add atomic i32 and u32 wrappers - #23572

Closed
mahkoh wants to merge 1 commit into
rust-lang:masterfrom
mahkoh:atomici32
Closed

mahkoh wants to merge 1 commit into
rust-lang:masterfrom
mahkoh:atomici32

Conversation

@mahkoh

@mahkoh mahkoh commented Mar 21, 2015

Copy link
Copy Markdown
Contributor

Atomic operations on these types are needed for interaction with certain system APIs.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@Manishearth

Copy link
Copy Markdown
Member

Can we just introduce stable APIs without an RfC?

@mahkoh

mahkoh commented Mar 21, 2015

Copy link
Copy Markdown
Contributor Author

There is nothing unstable about it unless you believe the whole "atomic wrapper" design is unstable. I agree that exposing the atomic functions directly would be a much better design. But since the usize-sized wrappers are already stable, copy-pasted versions with s/size/32/ cannot be less stable.

@Manishearth

Copy link
Copy Markdown
Member

That doesn't necessarily warrant circumventing the RfC process. (I'm not sure if that is the case here)

@mahkoh

mahkoh commented Mar 21, 2015

Copy link
Copy Markdown
Contributor Author

There are only two possible results of an RFC: Add atomic wrappers for 32 bit types or don't use any atomic wrappers. Anything between those two would lead to inconsistent design. Since AtomicUsize has already been declared stable without an RFC, the outcome has been decided.

@liigo

liigo commented Mar 21, 2015 via email

Copy link
Copy Markdown
Contributor

@Manishearth

Copy link
Copy Markdown
Member

I'm pretty sure AtomicUsize was around way before we worried about stability so much.

You're adding an API that is going to have to be there forever. I get that it's an obvious API to have. I get that it's something that doesn't have any iffyness in stability -- once added, it doesn't need changing. This doesn't change the fact that you're still adding a stable API, which needs an RfC.

It would be a simple RfC which would probably get accepted. But it still needs to exist.

@alexcrichton

Copy link
Copy Markdown
Member

Yes as @Manishearth and @liigo have mentioned, any new API in the standard library now requires an RFC for both inclusion and stabilization. While simple, there are still possible design axes here we may wish to explore which should be done through an RFC.

@mahkoh

mahkoh commented Mar 21, 2015

Copy link
Copy Markdown
Contributor Author

rust-lang/rfcs#1000

lnicola added a commit to lnicola/rust that referenced this pull request Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants