Do you know a C dictionary that supports COW transactions?

I am looking for a keyword library → value written in C that supports a theoretically unlimited amount of cheap transactions.

I would like to have one dictionary in memory, with hundreds of threads starting transactions, possibly changing the dictionary, ending (completing) the transaction, or potentially aborting the transaction. Only 50% of the time, these threads actually change the dictionary.

Most of the dictionary transaction implementations I've seen are always copied, not copied when writing, whenever a transaction starts. Given the expected size (> 1 GB) of the dictionary, I hope to find something that is COW only when something really changed during the transaction. I also hope that it is packed with most major GNU / Linux distributions.

Any suggestions or links are greatly appreciated.

+3
source share
2 answers

SQLite3 is transactional and can fully exist in memory . It's not as cheap as some might like when it comes to transactions, but not everything is expensive. Fast mlock () / mlockall () does not allow to unload DB, YMMV with posix_madvise (). This is not a solution, but not too difficult to adapt.

BDB is another option that Oracle is currently selling.

SQLite3 (). , Tumbleweed, , , , .

+1

SQLite ? , , .

BDB , , , .

, , - (, COWString), , stl:: map hash_map -. , COW , .

+1

Source: https://habr.com/ru/post/1737111/


All Articles