摘要:
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... 阅读全文
摘要:
重点: join()让父进程在原地等待。 阅读全文
摘要:
#子进程 和 父进程 的名称空间时相对独立的! # x = 1000 # def task(): # time.sleep(3) # global x # x = 123 # print('哈哈哈') # # if __name__ == '__main__': # print(x) # p = Process(target=task) # ... 阅读全文
摘要:
#方式一: 常用 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系... 阅读全文
摘要:
每个进程都有一个PID号,就像人有身份证号一样 阅读全文