4 ms·
Another option for variable size types not explored in the article is to set aside some contiguous part of memory for these objects. The main idea is to store p
by slaymaker1907 8y ago
Another option for variable size types not explored in the article is to set aside some contiguous part of memory for these objects. The main idea is to store pointers as relative addresses from the start of the memory region.
You can then avoid doing any copying or serialization by directly sending the entire memory region as a unit.
The main difficulties with this approach is in deciding how large to make these regions and also handling free over this region. The first part is often not too bad depending on the application, but handling deallocation and expanding/shrinking memory regions can be tricky. This allocation problem is much more difficult to dismiss since it is necessary to solve in order to avoid making the user decide how much memory to allocate initially which is impossible for many applications. For instance, when dealing with strings, it may be impossible to get a good bound on the size of these strings.
- amelius 8y ago> The main idea is to store pointers as relative addresses from the start of the memory region. One problem is that languages don't support the use of standard container types inside a region with a variable base address (variable because it will change the next time you call mmap). I think modern languages should support this concept, especially the ones that aim to be "systems" programming languages.
- Koshkin 8y ago> mmap Funny you should mention that - something has kept me thinking that the modern operating systems should have a built-in support for the cross-node sharing of the virtual memory via mmap.
- xiii1408 8y agoSome cool people at VMWare wrote some software that lets you manage RDMA segments as files in the file system [1]. And you can mmap those RDMA-resident files if you wish. [1] https://256fd102-a-62cb3a1a-s-sites.googlegroups.com/site/mkaguilera/remote-regions-atc2018.pdf https://256fd102-a-62cb3a1a-s-sites.googlegroups.com/site/mk...
- gpderetta 8y agoBoost.Interprocess does. Pointers to variable base addresses can be implemented as offset pointers (the trick is storing an offset from this instead of mmmap start address).