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 the frame number from the master program.
I have several questions--understanding the pros and cons from multi-processing versus multi-threading seen here: Multiprocessing vs Threading Python
Implementation Considerations:
Having too many plots created via threads in signal based architecture probably becomes laggy in terms of updating them I'm guessing. I'm not sure when they become CPU bound...most plots will update a few line series, some may update images. Perhaps it will be laggy regardless of which way I choose to do this regardless of creation method.
I'm not sure what opening 30 python processes, where each process makes a plot or two with matplotlib does to a machine or its resources. I see a single simple matplotlib plot on my system has an RSS (allocated memory) of 117M, so I don't think a single user plotting 30 plots would limit system memory if done by opening separate processes for each plot. (16 GB, 32-core Linux Boxes with several simultaneous users)
Questions:
- Should I open the plots via threads or processes and will one be less laggy than the other?
- If I use threads does anyone have any idea how many matplotlib figures it will take to update before it gets laggy on a single thread?
- If I create the plots as processes, should I use the multiprocessing package? I'm guessing this API makes it straight forward to communicate the frame number between processes?
- Given I have multi-processing available, it's probably silly to try to open processes through POpen right? I'm guessing this is the case because if I did this I would have to setup all of the piping/IPC myself which would be more work?