哪些情况会导致东京内阁封锁

发布于 2024-08-11 07:19:37 字数 146 浏览 5 评论 0原文

我正在使用 Tokyo Cabinet 和 python 中的 tc 模块。我以 TDB 格式存储数据。我预计该表仅在写入期间阻塞。不幸的是,我发现当文件在“写入器模式”下打开时,其他进程无法从中读取。这是标准行为、包装问题还是我做错了什么?或者可能还有其他情况导致操作被阻止?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌枕肩 2024-08-18 07:19:37

根据规范

Tokyo Cabinet提供两种模式
连接到数据库:“reader”和
“作家”。读者可以执行
检索但既不存储也不存储
删除。作家可以演绎一切
访问方法。排除控制
进程之间执行时
通过文件连接到数据库
锁定。 当作者已连接时
对于数据库来说,读者和
作家可以连接。

阅读器连接到数据库,
其他读者可以连接,但是
作家不能。据此
机制,数据一致性是
保证同时
多任务处理中的连接
环境。

您可以为每个写入操作创建并关闭写入器,也可以使用 Tokyo Tyrant 来提供并发访问。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文