There was a bit of experimentation around this in the Go implementation, though it stalled due to some trouble figuring out the allocation scheme. Links:
* https://github.com/zombiezen/go-capnproto2/issues/60 * https://github.com/justincormack/go-memfd * https://github.com/zenhack/capnp-memrpc-go * https://github.com/zombiezen/go-capnproto2/pull/61 -Ian Quoting 'Kenton Varda' via Cap'n Proto (2017-06-13 15:07:14) > Indeed, this was a major design goal! > I haven't personally used it this way yet, though I've used it for > mmap() many times, which has similar properties. > I would like to develop an RPC transport which uses shared memory. It > would be especially neat if the code could automatically upgrade to > shared memory whenever it detects that it's communicating over a unix > socket. > One interesting hurdle for comms is what happens if you don't trust the > sending process. If the memory is still shared, they can potentially > modify the data while you're consuming it. If you make sure to read > each bit of data no more than once, then in theory no attack is > possible -- but I haven't yet reviewed the Cap'n Proto library itself > to check that the pointer validation reads each bit once, which would > need to be guaranteed before an application could consider relying on > this. > Linux's memfds support "sealing" the memory after writing it so that > the consuming end can be assured that no further changes are occurring. > However, messages need to be pretty large before this becomes > worthwhile -- for typical-size messages, an upfront memcpy() will be > much faster. > -Kenton > > On Tue, Jun 13, 2017 at 11:26 AM, Omnifarious > <[1]omnifari...@gmail.com> wrote: > > Cap'n Proto seems like it would be ideal for a shared memory > communications channel, right down to the relative pointers. Has > anybody used it this way? What are the hurdles? > > -- > You received this message because you are subscribed to the Google > Groups "Cap'n Proto" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to [2]capnproto+unsubscr...@googlegroups.com. > Visit this group at [3]https://groups.google.com/group/capnproto. > > -- > You received this message because you are subscribed to the Google > Groups "Cap'n Proto" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [4]capnproto+unsubscr...@googlegroups.com. > Visit this group at [5]https://groups.google.com/group/capnproto. > > Verweise > > 1. mailto:omnifari...@gmail.com > 2. mailto:capnproto+unsubscr...@googlegroups.com > 3. https://groups.google.com/group/capnproto > 4. mailto:capnproto+unsubscr...@googlegroups.com > 5. https://groups.google.com/group/capnproto -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/capnproto.
signature.asc
Description: signature