import threading
def bug(num):
while 1:
print "bug!^C may not work!thread-%d"%num
threads=[]
for i in range(4):
threads.append(threading.Thread(target=lambda : bug(i)))
for th in threads:
th.start()
程序是这样的,ctrl+c不起作用
强制关闭终端后依然没有终止
在windows下关闭主窗口后所有线程就退出了
请问在linux下该如何解决呢?
def bug(num):
while 1:
print "bug!^C may not work!thread-%d"%num
threads=[]
for i in range(4):
threads.append(threading.Thread(target=lambda : bug(i)))
for th in threads:
th.start()
程序是这样的,ctrl+c不起作用
强制关闭终端后依然没有终止
在windows下关闭主窗口后所有线程就退出了
请问在linux下该如何解决呢?