new test for mp
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#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())
|
||||
Reference in New Issue
Block a user