|
Boost Users : |
Subject: [Boost-users] boost interprocess library and concurrency
From: Shane Miller (gshanemiller_at_[hidden])
Date: 2010-09-04 16:46:20
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)
- 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?
Has anybody solved these issues using CAS, transactions, or some other lock free solution?
- 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.
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.
Shane
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net