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

Is there any sample code for using capnproto on shm (not by writing to fd). #1832

Open
large-cat opened this issue Nov 3, 2023 · 1 comment

Comments

@large-cat
Copy link

Hi
Is there any sample code for using capnproto on SHM (not by writing to fd). One process to modify messages and another process to read them (under the premise of thread safety). I hope to save the message directly on SHM without any serialization or deserialization required. Or use the specified memory to initialize capnproto msg, so I can share this memory between two processes.
Looking forward to recovery.
Thank you.

@kentonv
Copy link
Member

kentonv commented Nov 3, 2023

There's no sample code, sorry. What you probably want to do is write custom subclasses of capnp::MessageReader and capnp::MessageBuilder which allocate their memory inside your shm region. It should be reasonably straightforward.

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

2 participants