Replies: 1 comment
-
Instead, what you want to do is create a custom subclass of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently developing an inter-process communication module in C++ that utilizes shared memory. I want to leverage Cap'n Proto's capabilities to handle serialization and deserialization.
Currently, when using MallocMessageBuilder, the writing process either:
Takes a kj::ArrayPtr firstSegment as input, or
Directly allocates new heap memory.
In both cases, the memory (whether externally provided or internally allocated) is eventually deallocated.
I'm considering whether it's possible to make MallocMessageBuilder write messages directly into shared memory, allowing another process to read from the same memory region. This would eliminate the need for an extra copy operation. The shared memory itself will be managed using a ring buffer.
Key Points:
Goal: Zero-copy IPC using shared memory + Cap'n Proto.
Current Limitation: MallocMessageBuilder assumes ownership and deallocates memory.
Proposed Solution: Configure MallocMessageBuilder to work with pre-allocated shared memory.
Memory Management: The shared memory will be managed via a ring buffer.
Would this approach be feasible? If not, what alternatives would you recommend?
Beta Was this translation helpful? Give feedback.
All reactions