import multiprocessing
import time

def task(arg):
time.sleep(1)
print(arg)

if name == 'main':
"""
常用功能:
- join
- daemon
- name
- multiprocessing.current_process()
- multiprocessing.current_process().pid

"""
for i in range(10):
    p = multiprocessing.Process(target=task, args=(i,))
    p.start()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-10-20
  • 2022-12-23
  • 2021-10-30
  • 2021-10-19
  • 2021-06-17
猜你喜欢
  • 2021-07-31
  • 2021-09-28
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2022-01-16
相关资源
相似解决方案