def fork_case():
#can't work under windows
print "Process %s start " %os.getpid()
pid=os.fork()
if pid==0:
print "i am child process %s. and my parent pid is %s " %(os.getpid(),os.getppid())
else:
print "i am parent process %s, and create my child process %s" %(os.getpid(),pid)
评论列表
文章目录