gpt4 book ai didi

python - 什么条件导致 Tokyo Cabinet 阻挠

转载 作者:太空宇宙 更新时间:2023-11-03 23:50:25 26 4
gpt4 key购买 nike

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

最佳答案

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

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

关于python - 什么条件导致 Tokyo Cabinet 阻挠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1752454/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com