Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

managed_shared_memory vs windows_shared_memory

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?

like image 739
SinisterMJ Avatar asked Nov 08 '22 17:11

SinisterMJ


1 Answers

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.

like image 189
orhtej2 Avatar answered Nov 15 '22 11:11

orhtej2