我有一个约10Gb的Boost.MultiIndex大数组。为了减少阅读,我认为应该有办法将数据保存在内存中,另一个客户端程序将能够读取和分析它。Boost.MultiIndex:有没有办法在两个进程之间共享对象?
什么是组织它的正确方法?
数组是这样的:
struct particleID
{
int ID;// real ID for particle from Gadget2 file "ID" block
unsigned int IDf;// postition in the file
particleID(int id,const unsigned int idf):ID(id),IDf(idf){}
bool operator<(const particleID& p)const { return ID<p.ID;}
unsigned int getByGID()const {return (ID&0x0FFF);};
};
struct ID{};
struct IDf{};
struct IDg{};
typedef multi_index_container<
particleID,
indexed_by<
ordered_unique<
tag<IDf>, BOOST_MULTI_INDEX_MEMBER(particleID,unsigned int,IDf)>,
ordered_non_unique<
tag<ID>,BOOST_MULTI_INDEX_MEMBER(particleID,int,ID)>,
ordered_non_unique<
tag<IDg>,BOOST_MULTI_INDEX_CONST_MEM_FUN(particleID,unsigned int,getByGID)>
>
> particlesID_set;
任何想法都欢迎。
亲切的问候阿尔曼。
编辑: RAM和核心数量不受限制。目前我有一个16Gb和8个核心。
更新
同样的问题,我是问在Boost.Users论坛上,我得到的回答来自华金中号洛佩斯·穆尼奥斯(Boost.MultiIndex的开发商)。 aswer是是的。可以使用Boost.Interprocess共享进程之间的multi_index。欲了解更多详情,请登录this link
行动,您的链接指向的线程已被删除... – Pietro 2011-03-31 10:46:59
@Pietro:这真的很奇怪:( – Arman 2011-03-31 10:56:36