Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] error_code_t = 9 (already_exists_error) while opening a fixed_managed_shared_memory
From: Gaetan Gaumer (gaetan.gaumer_at_[hidden])
Date: 2011-05-23 04:05:35


2011/5/20 Marsh Ray <marsh_at_[hidden]>:
> On 05/20/2011 03:15 AM, Gaetan Gaumer wrote:
>>
>> If two processes can't be sure to be able to map the segment at the same
>> address
>> then fixed_managed_shared_memory seems to be useless.
>
> Yes, in general I would not use fixed address shared memory.
>
> There are special circumstances where one might need it:
>
> * You might reserve the memory in one process and then fork(), ensuring that
> the child process has the same memory layout.
> * You may be able to pre-reserve address regions before anything else gets
> mapped in your process.
> * You may be using special kernel facilities or hardware devices that
> guarantee the memory range will be accepted.

So, as I'm not in one of these cases I should use
managed_shared_memory instead of
fixed_managed_shared_memory

>
> Maybe the docs could help new users by discussing these drawbacks a little
> more prominently?

Yes, I think it would be helpful.

Thanks all for your explanations.
Cheers,
Gaëtan


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