Boost logo

Boost Users :

Subject: Re: [Boost-users] Interprocess : appending data
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2013-05-06 12:25:20


El 06/05/2013 18:10, Oodini escribió:
> Hello,
>
> I create a shared_memory_object, truncate it to set its size, and
> then create a mapped_region.
>
> I would like to know it would be possible to append new data, by
> applying a new truncation.

Yes, if the underlying OS supports it (I think both Windows and POSIX
guarantee this.

> Also, is it possible to have a second name pointing in the same
> memory, but with an offset ?

Not a shared_memory_object (a shm object is similar to a file
descriptor), but you can have a mapped_region pointing to the same
memory starting in a different offset (mapped region always maps whole
pages so you might end consuming a bit more memory than needed if the
offset is not multiple of page size, but get_address() will return the
address resulting from base address + the offset you specified).

Best,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net