Hi,
Can anybody tell me how can I make the shared memory segment (together with the objects constructed in it) remain in memory AFTER the process which created it terminates?
Sadly, Shmem is based on Windows shared memory lifetime, that is, process-lifetime. With this lifetime, when the last process attached to a shared memory is detaches the memory, the shared memory is destroyed. There is chance to maintain the memory in Shmem. On the other hand, Boost.Interprocess, the official Boost library based on Shmem, has changed shared memory lifetime to POSIX lifetime (kernel or filesystem) so you must explicitly destroy the shared memory (using shared_memory_object::unlink()). So you can use Boost.Interprocess to achieve shared memory persistence. Current Boost.Interprocess snapshot is in Boost CVS and Boost.Vault/Concurrent Programming. It has several changes requested in Shmem review, but in general it should be easy to port your application to Boost.Interprocess. Regards, Ion