Python Forum
multiprocessing with objects? - help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
multiprocessing with objects? - help
#1
Photo 
Hello,

I"m trying to figure out if the multiprocessing module is the correct approach for my application. I have a python application architecture (I'm working towards) but I can't attach it I guess because I'm too new. So I'll describe it.

Basically I have a GUI class and I want that to launch another class to plot USB data streaming into the GUI. Because I'm using matplotlib I "think" I need to use the multiprocessing module because matplotlib isn't thread safe. From what I've read, if I use the multiprocessing library it will launch a new GIL and allow a second instantiation of python and matplotlib to run. So my architecture looks like two blocks really, (1). a main GUI block rx'ing the USB data to plot. It then passes that data to (2). a second set of modules/classes plots this streaming data and needs to be (I think) in another process from the multiprocess module. It is unfortunate I can't attach a picture.

When I look at tutorials/examples for the multiprocessing module the problem I see is that they all pass the multiprocessing API function calls. I am a little confused how to write this somewhat separate plotting app that will use maybe multiple classes rather than one simple short function. Can you for example, have one GUI use the multiprocessing module to launch another multi class/object GUI so there are two GUIs in two separate processes? If so, how do you do this if you have more than just a simple function. Say you want to write a class for this separate streaming plotting UI that uses matplot lib and other modules/classes and many functions?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using multiprocessing to produce objects for i in range lucasrohr 6 1,637 Feb-02-2022, 03:53 PM
Last Post: lucasrohr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020