c++ - Boost.Interprocess memory location -


in boost.interprocess documentation where being allocated? stated boost.interprocess containers placed in shared memory using 2 mechanisms @ same time:

  • boost.interprocess construct<>, find_or_construct<>... functions. these functions place c++ object in shared memory. places object, not memory object may allocate dynamically.
  • shared memory allocators. these allow allocating shared memory portions containers can allocate dynamically fragments of memory store newly inserted elements.

what use case have boost.vector internal memory lives in current process, using shared memory allocator elements placed in shared memory ?

if want share structure process :

struct shared {     vector<string> m_names;     vector<char>   m_data; }; 

i guess want vectors accessible other process can iterate on them, right ?

find_or_construct , friends own direct allocations.

the allocators passed library types internal allocations in similar fashion. otherwise, "control structure" (e.g. 16 bytes typical std::string) in shared memory, instead of related data allocated standard library container internally.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

angular - Copying node modules to wwwroot AspNetCore -