Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider graduating std::unstable::{sync,atomics} to std::sync #10627

Closed
alexcrichton opened this issue Nov 24, 2013 · 11 comments
Closed

Consider graduating std::unstable::{sync,atomics} to std::sync #10627

alexcrichton opened this issue Nov 24, 2013 · 11 comments

Comments

@alexcrichton
Copy link
Member

The utilities provided inside of std::unstable::{sync,atomics} are quite useful for writing concurrent code. It would be nice to polish off these interfaces and move them outside of the unstable module.

@emberian
Copy link
Member

I think this is blocking on #9758

@alexcrichton
Copy link
Member Author

UnsafeArc is correct as-implemented, that issue is just referring to putting unsafe_no_drop_flag on the struct causes problems. I do not think that that issue blocks this.

@thestinger
Copy link
Contributor

It's correct as-implemented but I'm not sure supporting unwrapping as it does it is a good idea. It seems like it would make a lot more sense to just use Arc<Option<T>>.

This is a lot simpler, and can use faster atomic ordering requirements:

https://github.com/thestinger/rust-core/blob/master/core/arc.rs

@brson
Copy link
Contributor

brson commented Dec 10, 2013

I also believe that UnsafeArc should not support unwrapping.

@brson
Copy link
Contributor

brson commented Dec 10, 2013

And agree that these should not be in the unstable module (which should be dismantled in favor of attributes anyway).

@brson
Copy link
Contributor

brson commented Dec 10, 2013

A lot of the stuff in sync though worries me - it's just misc stuff, and some of it is not appropriate for general use. LittleLock and Exclusive use native mutexes.

@brson
Copy link
Contributor

brson commented Dec 10, 2013

LittleLock is not the right name for something we want to be part of the public API, and both it and Exclusive are conflated with condvars.

@alexcrichton
Copy link
Member Author

I am currently doing this in a local branch, but it may take some time to land.

@alexcrichton
Copy link
Member Author

I'm leaving everything related to a mutex in unstable for now.

@alexcrichton
Copy link
Member Author

This has been done.

@alexcrichton
Copy link
Member Author

Or at least done to the degree that it should be done at this time.

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 23, 2023
…_types, r=xFrednet

Test all types supported by [`collection_is_never_read`]

changelog: none
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

No branches or pull requests

4 participants