0

I need to parallelize some internal function calls that I have in a class in a much larger homebuilt framework. I've attempted both multiprocessing and threading (separately), and when testing the amount of time required, I noticed that execution of those functions takes longer now than it did previously.

Reading over this question and this question, I realized that the issue is probably that I'm attempting to parallelize a class member function, and that I'm running into class instance issues with the subprocesses/threads.

I could move the function outside of the class definition, passing in required data structures, however the function in question is deeply coupled to other member functions.

My question is...do I need to move all member functions outside of the class definition to realize the speedup I require, or is my understanding of the problem flawed?

Community
  • 1
  • 1
erik
  • 3,810
  • 6
  • 32
  • 63

1 Answers1

0

For my implementation at least, I created a worker thread that handled all threaded code. That thread communicated to the main thread using a simple pipe. Easy to implement, and none of the overhead of mpc.

erik
  • 3,810
  • 6
  • 32
  • 63