Boost logo

Boost Users :

Subject: Re: [Boost-users] File-system persistence for boost shared memory files
From: Rajalakshmi Iyer (raj_at_[hidden])
Date: 2012-04-05 07:06:29


Thanks Ion,

I tried the workaround you have suggested, whereby I continue to use
managed_shared_memory but disable
BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS in
boost/interprocess/detail/workaround.hpp.

As a result the shared memory file that internally uses memory mapped files
is now created under /tmp/boost_interprocess rather than in /var/run/shm.
Note that the named mutex files are still created under /var/run/shm (that
should not be a problem though).

However, when I reboot the machine, the files created under
/tmp/boost_interprocess are wiped out. Is there anything additional I
should be doing?

Thanks,
Raj

2012/4/5 Ion Gaztañaga <igaztanaga_at_[hidden]>

> El 05/04/2012 10:14, Rajalakshmi Iyer escribió:
>
> Hello,
>>
>> The boost documentation suggests that shared memory interprocess
>> mechanism can have file-system or kernel persistence.
>>
>> When I create shared memory files on an Ubuntu Linux host, they are
>> created at /var/run/shm. But on a system reboot, the shared memory files
>> go away, which means they are using kernel persistence.
>>
>> How can I ensure that shared memory files persist across reboots?
>>
>
> You can't, as the OS chooses that. Can't you use memory mapped files?
> Those are portable and have well-known semantics..
>
> For systems without POSIX support interprocess uses memory mapped files in
> a temp directory. If you disable POSIX shm detection undefining
>
> BOOST_INTERPROCESS_POSIX_**SHARED_MEMORY_OBJECTS
>
> in boost/interprocess/detail/**workaround.hpp
>
> then you get shared memory emulation using memory mapped files.
>
> Ion
> ______________________________**_________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/boost-**users>
>

-- 
Twitter: @Blismobile <http://twitter.com/#!/blismobile>
BlisMobile Media 
32 Percy Street,
London W1T 2DE
www.blismobile.com
[image: BlisMobile] <http://www.blismobile.com/>[image: Follow on Twitter]<http://twitter.com/#!/blismobile>[image: 
Blis Website] <http://www.blismobile.com/>
This communication is from BlisMobile Media, which is a trading name of 
Breeze Tech (UK) Ltd, a company registered in England and Wales with 
registered number 06455773. Its registered office is 32 Percy Street, 
London W1T 2DE, United Kingdom.
 
This communication contains information that is confidential and may also 
be privileged. It is for the exclusive use of the intended recipient(s). If 
you are not the intended recipient(s), please (1) notify info_at_[hidden] by 
forwarding this email and delete all copies from your system and (2) note 
that disclosure, distribution, copying or use of this communication is 
strictly prohibited. Email communications cannot be guaranteed to be secure 
or free from error or viruses. All emails sent to or from a Blismobile 
email account are securely archived and stored by an external supplier. This 
email does not constitute a contractual agreement; such agreements are in 
specified contractual or Insertion Order (IO) form only 
and exclusively contain all the terms to which Breeze Tech )UK) Ltd will be 
bound. To the extent permitted by law, Breeze Tech (UK) Ltd does not accept 
any liability for use of or reliance on the contents of this email by any 
person save by the intended recipient(s) to the extent agreed in a contract 
or Insertion Order.
 
Opinions, conclusions and other information in this email which have not 
been delivered by way of the business of Breeze Tech (UK) Ltd are neither 
given nor endorsed by it.


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