Category : concurrent-processing

enter image description here import multiprocessing as mp import os def cube(num): print(os.getpid()) print("Cube is {}".format(num*num*num)) def square(num): print(os.getpid()) print("Square is {}".format(num*num)) if __name__ == "__main__": p1 = mp.Process(target = cube, args = (3,)) p2 = mp.Process(target = square, args = (4,)) p1.start() p2.start() p1.join() p2.join() print("Done") enter image description here I was using the ..

Read more