Boost.MultiIndex: Are there way to share object between two processes?

Posted by Arman on Stack Overflow See other posts from Stack Overflow or by Arman
Published on 2010-04-06T10:52:48Z Indexed on 2010/04/06 11:23 UTC
Read the original article Hit count: 440

Filed under:
|

Hello, I have a Boost.MultiIndex big array about 10Gb. In order to reduce the reading I thought there should be a way to keep the data in the memory and another client programs will be able to read and analyse it.

What is the proper way to organize it?

The array looks like:

    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;

Any ideas are welcome.

kind regards Arman.

© Stack Overflow or respective owner

Related posts about c++

Related posts about boost-interprocess