views:

228

answers:

1

I'm using Tokyo Cabinet with the tc module in python. I store my data in the TDB format. I expected the table to block only for the duration of a write. Unfortunately, I see that when the file is open with in the "writer mode", other processes cannot read from it. Is that a standard behaviour, wrappers problem, or am I doing something wrong? Or maybe there are other cases when the operations are blocked?

+2  A: 

According to specification:

Tokyo Cabinet provides two modes to connect to a database: "reader" and "writer". A reader can perform retrieving but neither storing nor deleting. A writer can perform all access methods. Exclusion control between processes is performed when connecting to a database by file locking. While a writer is connected to a database, neither readers nor writers can be connected. While a reader is connected to a database, other readers can be connect, but writers can not. According to this mechanism, data consistency is guaranteed with simultaneous connections in multitasking environment.

You have either create and close writer for each write operation or use Tokyo Tyrant to provide concurrent access.

Denis Otkidach