0
from ProjectName.PackageName1.class1 import CLass1
from ProjectName.PackageName1.class2 import CLass2
Class Main_input:

obj1 = Class1()
obj2 = Class2()

list_of_args = obj1.function1(args)

if __name__ == "__main__":
p1= multiprocessing.Process(target=obj2.function2, args=list_of_args)
p1.start()
p1.join

When I am running the above code I am expecting

  1. the function1 of Class1 to run first - This will return a list_of_args
  2. Create a process p1 which will run Function2 of class2, iterating over the list_of_args wherein the items in the list will be divided into the processes and the function will run concurrently of different values

What is happening

  1. The function1 is running fine and returning list_of_args BUT when I create a process and I start the process, it is again running the below code again and again
list_of_args = obj1.function1(args)

How should I fix this?

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Does this answer your question? [Python multiprocessing linux windows difference](https://stackoverflow.com/questions/42148344/python-multiprocessing-linux-windows-difference) – Ahmed AEK Dec 31 '22 at 08:32

0 Answers0