Possible Duplicate:
Clean way to get near-LIFO behavior from multiprocessing.Queue? (or even just *not* near-FIFO)
我想分享后进先出(Queue.LifoQueue())两个不同Python程序之间的结构。在
一个充当作者,另一个充当读者
现在它只是一个简单的应用程序来共享读/写时间。在
读取器应在后进先出中插入UNIX时间戳,然后读取器读取:
**#writer.py**
def getWriteTime():
os.system("date +%s")
# write to the LIFO structure
**#reader.py**
def getReadTime():
# read from the LIFO structure
# do calculations
问题是,如何在两个python程序之间共享相同的数据结构而不将其写入磁盘?在
我知道多处理库允许在进程之间共享资源,但我不太了解如何在python程序之间共享LIFO(队列)
提前谢谢你
使用某种第三个进程来托管共享数据结构。http://redis.io是一个流行的选择。在
相关问题 更多 >
编程相关推荐