
El 04/09/2010 22:46, Shane Miller escribió:
Hi,
After reading through the BOOST interprocess library documentation I cannot workout whether
- its STL set/hash/vector containers are multi-threaded safe. (Seeming, no, is the answer)
No, they have the same guarantees as common STL containers.
- if a program cores in the middle of write operation to a STL container in shared memory then clearly the container is in an undefined state. Locks might be left locked (if this BOOST library uses locks say in a STL set or hash map insert/update). Now what? We just throw away the shared memory segment and start again?
Same as if a thread dies when updating a STL container
- aside from these issues, suppose one allocates a 2GB shared memory segment and all 2GB is used by a STL set. Does this BOOST interprocess library support adding more shared memory segments so this STL set can grow larger? Does doing so require relocating it which is a slow operation? What are the details here.
No, the library only supports offline "grow".
I am looking for a crash recoverable, concurrent shared memory implementation of STL. Mainly I have a cache of items that will be read-intensive with some periodic updates and insertions throughout the day. Key-value pairs won't work; it must operate on pointers to C++ structs.
Maybe you are asking too much ;-) Now, seriously maybe a DB is what you need. Best, Ion