Subject: Re: [boost] Interprocess regexes
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2009-12-05 11:55:31
John Maddock" wrote:
>>> basic_string and other containers take an
>>> allocator template argument, while basic_regex does not.
>>> If basic_regex had an allocator it would reap all the same benefits that
>>> other string and container types do. In particular, it would be possible
>>> to use boost::interprocess to place them in shared memory.
>> IIUC, while the custom allocators let you put std::containers in shared
>> memory they are still not very useful since they can only be used by
>> the process that put them there - other processes will (potentially)
>> see the shared memory at a different address and all the pointers will
>> be wrong. Is this level of functionality useful to you?
> That would certainly be a killer blow as far as using this with regex is
> concerned... but don't you have the option of at least trying to load shared
> memory at a specific address?
Yes you can ask to map it at a particular address, but that can fail.
Actually there is another case that I forgot about before: if you
create the shared memory before forking, the new process will see it at
the same address as its parent. So this could be useful in that
situation. Sorry, it's a while since I did anything with shared memory...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk