multiprocessing-manager

Python IPC with matplotlib

ぐ巨炮叔叔 提交于 2019-11-28 06:40:38
问题 Project description: Connect existing "C" program (main control) to Python GUI/Widget. For this I'm using a FIFO. The C program is designed look at frame based telemetry. The Python GUI performs two functions: Runs/creates plots (probably created through matplotlib) via GUI widget as the user desires (individual .py files, scripts written by different users) Relays the frame number to the python plotting scripts after they have been created so they can "update" themselves after being given

Sharing object (class instance) in python using Managers

笑着哭i 提交于 2019-11-28 06:34:13
I need to share an object and its methods between several processes in python. I am trying to use Managers (in module multiprocessing) but it crashes. Here is a silly example of producer-consumer where the shared object between the two processes is just a list of numbers with four methods. from multiprocessing import Process, Condition, Lock from multiprocessing.managers import BaseManager import time, os lock = Lock() waitC = Condition(lock) waitP = Condition(lock) class numeri(object): def __init__(self): self.nl = [] def getLen(self): return len(self.nl) def stampa(self): print self.nl def