简体   繁体   English

多线程环境下的rocksdb

[英]rocksdb in multithreaded environment

I'm using rocksdb in a multithreaded environment.我在多线程环境中使用rocksdb。

All of my threads are doing get() , put() and merge() operations, potentially with the same keys.我的所有线程都在执行get()put()merge()操作,可能使用相同的键。

Is rocks providing me with any built in synchronization?岩石是否为我提供了任何内置的同步? Is it configurable?可配置吗? I've gone through documentation and source code, but couldn't figure it out for certain.我已经浏览了文档和源代码,但无法确定。

There's no such synchronization.没有这样的同步。

You're only guaranteed that get , put and merge operations are atomic.您只能保证getputmerge操作是原子的。 However, if you are trying to read and write the same key-value pair in a multi-threaded environment, the operations' order is NOT determined.但是,如果您尝试在多线程环境中读取和写入相同的键值对,则无法确定操作的顺序。 You have to do the synchronization yourself.您必须自己进行同步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM