Files
h2inc-old/Multiprocessing test/mthread.py
2018-05-17 21:44:45 +02:00

17 lines
340 B
Python

#import threading
import multiprocessing
import time
class MyThread(threading.Thread):
def run(self):
time.sleep(5)
return
if __name__ == '__main__':
for i in range(3):
t = MyThread()
t.start()
print(t.name, 'is alive -> ',t.is_alive())
t.join()
print(t.name, 'is alive -> ',t.is_alive())