Multiprocessing for creating objects + calling functions using starmap() Python
问题 I would like to create objects of class Training and create multiple processes which call the print() function. I have a class Training : class Training(): def __init__(self, param1, param2): self.param1 = param1 self.param2 = param2 def print(self): print(self.param1) print(self.param2) I have tried to use the starmap function to create 5 processes in the following way: import multiprocessing as mp num_devices = 5 func_args = [] for i in range (0, num_devices): func_args.append((i, i*10))