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

Relationship to shared_memory? #2

Closed
asajeffrey opened this issue Nov 6, 2019 · 4 comments
Closed

Relationship to shared_memory? #2

asajeffrey opened this issue Nov 6, 2019 · 4 comments
Labels
question Further information is requested

Comments

@asajeffrey
Copy link

There's another crate with similar goals to this one, which is https://github.com/elast0ny/shared_memory-rs/ which https://github.com/asajeffrey/shared-data/ builds on. I wonder if there's a connection, and whether shared_memory's support for other architectures can be used?

@asajeffrey
Copy link
Author

cc @elast0ny

@Ekleog
Copy link
Collaborator

Ekleog commented Nov 6, 2019

As far as I understand shared_memory-rs, its SharedMem appears to be doing much more than our Shared does, with all the locking.

OTOH, its SharedMemRaw appears to be more unsafe than our Shared, due to its not requiring ProcSync.

Overall, I think the big difference between shared_memory-rs and shmem is that shmem attempts to be as thin a wrapper around mmap as possible (while being safe thanks to requiring ProcSync -- being a thin wrapper also means exposing functions like from_raw_fd etc.), while shared_memory provides both a completely-unsafe and a locked version of shared memory.

Oh, and the last difference is that our Shared stores directly an object type, while SharedMem appears to provide interface only to a batch of memory.

Now, I say that based only on a quick skim of shared_memory-rs, maybe I'm mistaken about it?

@asajeffrey
Copy link
Author

That seems accurate. The shared_memory crate is about getting a *mut u8 pointing into shared memory, safely accessing it is another matter.

@Ekleog
Copy link
Collaborator

Ekleog commented Apr 3, 2020

(closing, as the question appears to have been answered)

@Ekleog Ekleog closed this as completed Apr 3, 2020
@Ekleog Ekleog added the question Further information is requested label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants