The most recent version of this FAQ can always be found
here.
You should not pass or store references to elements in an external memory data structure. When the reference is used, the block that contains the element may be no longer in internal memory.
Use/pass an iterator (reference) instead.
For an
stxxl::vector with
n pages and LRU replacement strategy, it can be guaranteed that the last
n references obtained using
stxxl::vector::operator[] or dereferencing an iterator are valid. However, if
n is 1, even a single innocent-looking line like
std::cout << v[0] << " " << v[1000000] << std::endl;
can lead to inconsistent results.
The I/O and block management layers are thread-safe (since release 1.1.1). The user layer data structures are not thread-safe.
I.e. you may access
different STXXL data structures from concurrent threads without problems, but you should not share a data structure between threads (without implementing proper locking yourself).
This is a design choice, having the data structures thread-safe would mean a significant performance loss.
This may happen if the disks have different size. With the default parameters
STXXL containers use randomized block-to-disk allocation strategies that distribute data evenly between the disks but ignore the availability of free space on them.