2011/5/20 Marsh Ray
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