摘要:
from multiprocessing import Process import time def task(name): print("%s start" % name) time.sleep(3) print("%s stop" % name) if __name__ == '__main__': p = Process(target=task,a... 阅读全文
posted @ 2018-11-07 20:28
萤huo虫
阅读(607)
评论(0)
推荐(1)
摘要:
重点: join()让父进程在原地等待。 阅读全文
posted @ 2018-11-07 20:24
萤huo虫
阅读(738)
评论(0)
推荐(0)
摘要:
#子进程 和 父进程 的名称空间时相对独立的! # x = 1000 # def task(): # time.sleep(3) # global x # x = 123 # print('哈哈哈') # # if __name__ == '__main__': # print(x) # p = Process(target=task) # ... 阅读全文
posted @ 2018-11-07 20:12
萤huo虫
阅读(339)
评论(0)
推荐(0)
摘要:
#方式一: 常用 from multiprocessing import Process import time def task(name): print('%s is running' %name) time.sleep(3) print('%s is done' %name) if __name__ == '__main__': # 在windows系... 阅读全文
posted @ 2018-11-07 20:10
萤huo虫
阅读(294)
评论(0)
推荐(0)
摘要:
每个进程都有一个PID号,就像人有身份证号一样 阅读全文
posted @ 2018-11-07 20:05
萤huo虫
阅读(431)
评论(0)
推荐(0)

浙公网安备 33010602011771号