from multiprocessing import Process
from multiprocessing import Event
def task(e):
e.wait()
print("Hello world!")
if __name__ == '__main__':
event = Event()
process = Process(target=task, args=(event,))
process.start()
for i in range(0, 100):
if i % 2 == 0:
event.set()