You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@stdcxx.apache.org by Azrael <41...@qq.com> on 2012/01/01 06:49:19 UTC

Can I use stdcxx4.2.1 containers on share memory?

Hi , I am now searching for a stl implementation who's containers can work perfectly with alternative pointers define in the allocator given. 
 Because I want to make my program able to attatch to a block of share memory and continue it's previous work. The GCC default implementation use standard pointer in the container base, such as rb_tree_node_base etc. 
 And I found that stdcxx4.2.1 use the alloc::pointer instead. So ,I wonder if I can safely use stdcxx4.2.1 on share memory by simply define my own  shm_allocator and shm_handle(pointer type recording the offset in share memory).
 Actually, I am implementing a game server, so ,I require really good performace. 
 So, is stdcxx4.2.1 suitable for me?
  
 Really need help.....wait for response.

Re: Can I use stdcxx4.2.1 containers on share memory?

Posted by Martin Sebor <ms...@gmail.com>.
On 12/31/2011 10:49 PM, Azrael wrote:
> Hi , I am now searching for a stl implementation who's containers can work perfectly with alternative pointers define in the allocator given.
>   Because I want to make my program able to attatch to a block of share memory and continue it's previous work. The GCC default implementation use standard pointer in the container base, such as rb_tree_node_base etc.
>   And I found that stdcxx4.2.1 use the alloc::pointer instead. So ,I wonder if I can safely use stdcxx4.2.1 on share memory by simply define my own  shm_allocator and shm_handle(pointer type recording the offset in share memory).
>   Actually, I am implementing a game server, so ,I require really good performace.
>   So, is stdcxx4.2.1 suitable for me?
>
>   Really need help.....wait for response.

IIRC, we successfully tested all contains with shared memory
allocators except for std::list. The problem with list was
getting its pointers to work correctly as user-defined types.
I was hoping to find a test we used to exercise them in the
test suite but so far I don't see it.

Martin