Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] error_code_t = 9 (already_exists_error) while opening a fixed_managed_shared_memory
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-05-20 09:15:31


El 20/05/2011 10:15, Gaetan Gaumer escribió:

> 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.

You have the same problem with mmap or MapViewOfFile in windows. The
application must be sure that address range free. It's not an
Interprocess issue. Depending on your system, you might know which
address might be free (maybe your OS allocates new address range in a
well-known way, and you know which range will be surely free).

> As we're working on Linux, do you think that using xsi_shared_memory
> could help ?

You have the same issue. Address range is allocated by the OS for
several resources and the allocation depends on what the application
loads. Fixed mapping is not very usable unless you control your
environment very well. And for some security reasons (making things more
difficult to hackers), the loader might load your application in a
different address each time you start:

http://en.wikipedia.org/wiki/Address_space_layout_randomization

Best,

Ion


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