ctx = mp.get_context()


class MyProcess(ctx.Process):

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
print("Hi, I'm custom a process")
ctx.Process = MyProcess

def worker(x):
    print(x ** 2)
p = ctx.Pool(4)
nums = list(range(10))
p.map(worker, nums)
Python multiprocessing: Pool of custom Processes