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

Shared memory question? #14

Open
oak-tree opened this issue Apr 18, 2019 · 2 comments
Open

Shared memory question? #14

oak-tree opened this issue Apr 18, 2019 · 2 comments

Comments

@oak-tree
Copy link

Hey,
Your project looks promising. Can it work with shared memory? We would like to have a ring buffer between two different processes to share images and metadata

@Quuxplusone
Copy link

I suspect the short answer is "no"; but can you share more of your requirements?

  • Do the two processes see the ringbuffer as having the same address, or is it mapped differently in each process? For example, if Process A thinks &buffer.front() == (void*)0x00128748, are we guaranteed that Process B thinks &buffer.front() == (void*)0x00128748, or might it happen that in Process B &buffer.front() == (void*)0x07CE8748?

  • Do you require the ringbuffer itself to handle synchronization, or do you have external synchronization (e.g. a mutex)? For example, if Process A is calling push() at the same time that Process B is calling pop(), that probably won't work, as written.

  • Suppose the ringbuffer becomes completely full and then Process A tries to push onto it again. Can you assume that that's never going to happen (i.e., if it does happen, the behavior is undefined)? Or must the ringbuffer somehow support that situation? (If the latter: ring_span_lite definitely won't work, as written.)

@martinmoene
Copy link
Owner

[I've no experience with shared memory]

...Under Windows read/write require the use of CopyMemory(), while there's no Pusher (anymore) to get a 'handle' on writing...

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

3 participants