On 05/19/2011 11:26 AM, Gaetan Gaumer wrote:
2011/5/19 Marsh Ray
: 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