Conversation
|
@stevenengler friendly ping; lmk if you'd like to chat about this one or anything |
stevenengler
left a comment
There was a problem hiding this comment.
Looks really cool! I'm not the best person to look for memory safety stuff, but I added some comments for the things that I saw.
|
Might be useful to look at one commit at a time - I added a fixup commit responding directly to feedback, and another addressing potential Pin safety issues |
sporksmith
left a comment
There was a problem hiding this comment.
Oops, forgot to actually send my responses
stevenengler
left a comment
There was a problem hiding this comment.
I can't review the Pin stuff since I don't know much about it. I do think it would be nice to have a better solution for the "UnsafeCell within a immutable buffer" issue, but I know you're actively in discussion about that, so I don't want to hold back this PR. But regardless it looks pretty cool and interested to see where it goes :)
This is a Mutex suitable for use in shared memory. * Has a fixed layout (repr(C)) * Self-contained (no pointers) * Works across processes (e.g. doesn't use FUTEX_PRIVATE_FLAG)
|
After rebasing, one of the tests broke in units.rs: https://github.com/shadow/shadow/runs/8160879195?check_suite_focus=true#step:3:328 I can't figure out how it's breaking in this PR but not in main, but the fix is trivial so I just went ahead and added it |
This is a Mutex suitable for use in shared memory.
I've also implemented
rkyv::Archiveandrkyv::Serializefor it. This facilitates using it inside of types meant to be serialized with rkyv. That in turn may be useful for safely managing shared memory.