Subject: [Boost-bugs] [Boost C++ Libraries] #7927: boost::bimap not boost::interprocess compatible.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-25 16:33:50
#7927: boost::bimap not boost::interprocess compatible.
----------------------------------------------+-----------------------------
Reporter: jdy@⦠| Owner: matias
Type: Bugs | Status: new
Milestone: To Be Determined | Component: bimap
Version: Boost 1.52.0 | Severity: Problem
Keywords: bimap, multi_index, interprocess |
----------------------------------------------+-----------------------------
I've been trying to get boost::bimap to work in a
boost::interprocess::managed_mapped_file.
According to Matias Capeletto in this thread on the boost devel mailing
list:
http://thread.gmane.org/gmane.comp.lib.boost.devel/238100/
Bimap is just given your allocator to MultiIndex.
The issue is that the map views (left, right and relation set) are
initialized with a reference to the multiindex core in construction
time... when interprocess read it from memory the second time this
references are garbage. A direct solution will be to use interprocess
offset_ptr, but that will have a performance hit so I will have to
rethink how the views are accessing the core, probably using CRTP.
I've attached two small programs. Both compile with g++ 4.7. One
(multiindex.c++) puts a multi_index into the managed_mapped_file. On
the first run, it creates the data structure puts some stuff in it,
then reopens the data structure and outputs the stuff. On the second
run, it does the same thing, but it uses the data stored in the mapped
file.
The other program (bimap.c++) does exactly the same thing, but when
run the second time it crashes. My guess is because bimap isn't quite
interprocess compatible---that is, it isn't using the provided
allocator for EVERYTHING.
Compiled with:
{{{
g++ -o multiindex multiindex.c++ -lpthread
}}}
and
{{{
g++ -g -o bimap bimap.c++ -lpthread
}}}
Joel
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7927> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC