Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] error_code_t = 9 (already_exists_error) while opening a fixed_managed_shared_memory
From: Marsh Ray (marsh_at_[hidden])
Date: 2011-05-19 12:49:09


On 05/19/2011 11:26 AM, Gaetan Gaumer wrote:
> 2011/5/19 Marsh Ray<marsh_at_[hidden]>:
>>
>> Perhaps that address space was already being used by something. This is
>> likely to be the case with large regions on a 32-bit OS.
>
> It's indeed used by something as it is the address of the segment return by a
> new fixed_managed_shared_memory(boost::interprocess::create_only,...)

But that was in another process, right?

In general, mappings in process A do not reserve that same address
region in other processes. There are some OS-specific exceptions. If
this were not the case, a process which mapped all the free regions in
its own address space would cause problems for every other process in
the system.

> Currently 250MB but we want to use bigger segments soon.
> 64 bits

Ought to be fine.

>> What happens if something else is already at that address?
>
> According to mmap spec
> (http://pubs.opengroup.org/onlinepubs/009695399/functions/mmap.html)
> "mmap() may return MAP_FAILED and set errno to [EINVAL]"

Right, it fails.

> But in our case the address is used by the segment we want to open...

Again, that's a different process and each has its own address space.
Unless I'm misunderstanding your design.

- Marsh


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