managed_shared_memory vs windows_shared_memory

857 views Asked by At

I am currently looking at the documentation for Boost's interprocess library, and am trying to figure out what the difference is.

From all I can tell the only difference is the persistence (windows shared memory is released when the last process exits, managed_shm is released only when told so), are there other differences like speed or so that I am missing?

1

There are 1 answers

0
orhtej2 On BEST ANSWER

The difference is managed_shared_memory follows POSIX requirements, thus emulating the parts that windows_shared_memory is missing (i.e. persistence). This is done via memory file mapping.

The downsides of managed_shared_memory seems to be interopability with other applications (that use native windows shared memory) and potentially speed upon first access. The downside of windows_shared_memory on the other hand is lack of portability between systems.