什么情况导致东京内阁

2024-04-29 00:14:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Tokyo Cabinet和python中的tc模块。我以TDB格式存储数据。我希望表只在写入期间阻塞。不幸的是,我看到当文件以“writer模式”打开时,其他进程无法从中读取。这是标准行为、包装器问题还是我做错了什么?或者可能有其他的情况下,行动受阻?在


Tags: 模块文件数据标准进程格式模式情况
1条回答
网友
1楼 · 发布于 2024-04-29 00:14:17

根据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.

您可以为每个写操作创建并关闭writer,或者使用Tokyo Tyrant来提供并发访问。在

相关问题 更多 >