
hgdhfdghsa@Safe-mail.net wrote:
Hello,
in my application I am forced to create a shared memory segment whose size can change at runtime. Is it possible to implement such a shared memory segment using the boost.interprocess library? I do not want to pre-allocate a big shared memory segment, as in most cases the segment is small (about 100bytes). Just in some very rare cases it gets very big (5MB or even more).
Thank you
Sorry, but this is an issue that no one has solved yet ;-) The only thing you can do is to grow it offline (that is, without processes connected to it). See "Growing managed segments" in the documentation. Growing shared memory dynamically is well beyond the scope of a library. I would need the help of the OS to automatically increase the memory mappings of all processes atomically. Even with the OS, I don't think it's possible without the collaboration and processes. It's in the to-do list, but I don't see how could I implement it. Regards, Ion