3
之間的LIFO結構
可能重複:
Clean way to get near-LIFO behavior from multiprocessing.Queue? (or even just *not* near-FIFO)共享兩個Python程序
我想分享一個LIFO(Queue.LifoQueue())兩個不同的Python程序之間的結構。
將充當作家,另一個爲讀者
現在它只是一個簡單的應用程序共享的讀/寫速度。
讀者應該對LIFO插入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(隊列)
預先感謝您