1 #!/usr/bin/python 2 from multiprocessing import Process,Event 3 import os,time 4 5 def A(e): 6 print "block Process :starting" 7 e.wait() 8 print "event is set >>",e.is_set() 9 10 def B(e,t): 11 print "non-block Process :starting" 12 e.wait(t) 13 print "non-event is set >>",e.is_set() 14 15 e=Event() 16 m=Process(target=A,args=(e,)) 17 m.start() 18 n=Process(target=B,args=(e,3)) 19 n.start() 20 21 print "main process" 22 time.sleep(8) 23 e.set() 24 print "main is over"