Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
173 stars 8 forks source link

you can have just one open session #93

Closed alm0ra closed 9 months ago

alm0ra commented 9 months ago

I have a problem with that why when it's open by a session it will lock for others.

I want to use that to give the option to use other's concurrent

alm0ra commented 9 months ago

I have a problem with that why when it's open by a session it will lock for others.

I want to use that to give the option to use other's concurrent

Exception: IO error: While lock file: /home/ali/b/test_dict/LOCK: Resource temporarily unavailable
Congyuwang commented 9 months ago

Rocksdb by design cannot be shared across processes, while it may be shared across threads. Given that python is a single threaded language, you might want to use some messaging techniques or queues to orchestra your multiple processes while utilising a single process for writing to the database.