-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
ShMem
should probably require stored values to be Sync
#2809
Comments
Feel free to try, but a lot other things may break(?).. |
Really, the only way to actually prevent data-races would be to redesign |
I don"t think that would help, rust doesn"t understand about fork at all... |
Right, I was just trying to brainstorm such a higher-level abstraction.
Agreed, but I think it"s worth putting time and energy into exposing interfaces that are as easy to use correctly (and difficult to use incorrectly) as possible, even if they can"t ultimately be made safe. Adding |
Feel free to do so. I agree it feels more "more right" and def. cannot hurt |
ShMem
can be used to create data-races if you use it to store non-Sync
types such asCell
. For example, the assertion at the end of the following program fails:Of course, you can also create data-races just by using
as_mut_ptr
... But fixing that would require a whole different design, whereas it would be pretty easy to add aSync
bound toShMemProvider::new_on_shmem
,ShMem::as_ptr_of
, etc..The text was updated successfully, but these errors were encountered: