Grundlegende Verwendung Python Multiprocessing -01

importieren Multiprozessing
Importzeit

def Aufgabe (ARG):
time.sleep (1)
print (arg)

wenn Name == ' Haupt ':
""“
常用功能:
- beitreten
- Daemon
- Name
- multiprocessing.current_process ()
. - multiprocessing.current_process () pid

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

Ich denke du magst

Origin www.cnblogs.com/pythonPath/p/12459983.html
Empfohlen
Rangfolge