Python 中线程的 is_alive() 返回 Flase 意味着 线程资源已经被回收了吗?
資深大佬 : chaleaoch 13
线程资源已经被销毁?
它的子线程会被自动回收吗?
以下代码输出
test1 aps irr irr irr
没想明白为什么.
代码如下
import threading import time def irr(): print('irr') def aps(): print('aps') while True: time.sleep(6) irr() def view(): t2 = threading.Thread(target=aps) t2.daemon = True t2.start() print('test1') t = threading.Thread(target=view) t.daemon = True t.start() while True: time.sleep(1)
大佬有話說 (10)