Implementing STL container in shared memeory

P

Pallav singh

Can we implement generic container like vector and set in shared
memory region ( we get from Linux system calls shmget( ) ,
shmat( ) ) ??

i am facing problem in that ?
 
K

kasthurirangan.balaji

Can we implement generic container like vector and set in shared
memory region ( we get from Linux system calls   shmget( ) ,
shmat( ) ) ??

i am facing problem in that ?

Shmget,shmat and all other system calls are not c++ standard. More
over these calls are system specific.

Coming to c++ vector, this template has 2 parameters(template
parameters). First is the generic type and the second an allocator
that is defaulted. This default allocator uses heap for memory
requirements. We could replace this allocator with our own one which
could possibly use shmget and so. You may want to refer to the link
below

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2044.html

Thanks,
Balaji.
 
E

Erik Wikström

Can we implement generic container like vector and set in shared
memory region ( we get from Linux system calls shmget( ) ,
shmat( ) ) ??

i am facing problem in that ?

Only with synchronising operations to the vector, and (as Balaji pointed
out) finding an allocator that used the shared memory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top