gpt4 book ai didi

python - 在实时 pytables 上写入和读取

转载 作者:太空宇宙 更新时间:2023-11-04 06:05:55 25 4
gpt4 key购买 nike

我不确定我的想法是否可行,我需要有使用 HDF5/PyTables 经验的人的帮助。

场景是这样的:

假设我们有一个进程、一台机器或一个连接等,正在获取数据并以 HDF5/PyTable 格式存储。我将其称为商店软件。

是否有可能有另一个软件,我称之为分析软件,按时运行?

如果有帮助,商店软件和分析软件将完全独立,甚至用不同的语言编写。

我的疑问是,如果存储程序正在写PyTable,mode='w',那么分析程序是否可以同时访问mode='r ',并读取一些数据以执行一些基本分析、平均值等??。

其基本思想是能够实时分析存储在 PyTable 中的数据。

当然,我们将不胜感激任何其他提议的解决方案。

最佳答案

不推荐也不支持在一个进程中写入并在其他进程中读取。从HDF 5 FAQ看这个问题:

Does HDF5 support concurrent access to a single dataset from multiple processes?

If all processes are reading, then, yes, HDF5 (serial) does support this. If there are any processes that are writing, then no, this is not supported. We are working on a "Single Write Multiple Read" (SWMR) feature, which will be available in a future release (expected to be in HDF5-1.10).

Pytables 不保证@SmCaterpillar 所述的这种写/读模式。

关于python - 在实时 pytables 上写入和读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22062837/

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