-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Extra impl for (not-unsafe) Freeze version of MutexARC accessor methods #7473
Comments
Actually, there cannot be a non-freeze version of RWArc, even if it's labelled "unsafe" because of nesting. The entire point there is that the freeze requirement on RWArc contents enable the immutable read-mode. So, renaming this issue. However, we could still have dual impls for the MutexArc, as the MutexArc only has a mutable access mode. A safe access mode for Send+Freeze MutexArc contents would be desirable to users who wish to have slightly better performance (mutexes are faster than rwlocks) and don't require a read mode. I envision the current "access" and "access_cond" methods on MutexArc being changed to "unsafe_access" and "unsafe_access_cond", and having the prior names be used in the safe impl. (The constructors and unwrap method are safe even if the data doesn't freeze.) Unassigning myself; this should be a pretty approachable code refactor for a newcomer. |
I'd like to take this one! |
OK |
What would be the advantage of keeping unsafe_access and unsafe_access_cond ? |
there should be two impls, one for each combination of kinds. |
r=? |
@flaper87 have you opened a pull request with that commit? |
Just did! Damn, GH failed me before! Thanks for the comment! |
r=? |
Current access methods are nestable and unsafe. This patch renames current methods implementation - prepends unsafe_ - and implements 2 new methods that are both safe and un-nestable. Fixes #7473
nice job @flaper87 |
Fix ICE in `is_integer_const` fixes: rust-lang#7340 changelog: Fix ICE in `modulo_one` in const contexts
Rustup r? `@ghost` Out of cycle sync for 2 ICE fixes rust-lang#7470 rust-lang#7471 rust-lang#7473 changelog: none
MutexARC and RWARC both make opposite choices for two different design features (safety-vs-nesting and rwlock-vs-mutex), excluding the other two combinations. We could permit the other combinations simply by adding extra impls with stub methods that called out to their counterpart.
The text was updated successfully, but these errors were encountered: