from multiprocessing import Process,Lockdef run_lock(l,i): l.acquire() print("Hello ",i) l.release()l=Lock()if __name__=="__main__": for i in range(10): p=Process(target=run_lock,args=(l,i)) p.start()