下面是一个冻结的简单示例,因为子进程退出时没有返回任何内容,而父进程一直在等待。如果进程花费的时间太长,有没有办法让进程超时,让其余的进程继续运行?我是python中多处理的初学者,我发现文档并不是很有启发性。import time
if x == 3: #some heavy computation here pool = mp.Poo
我在Linux上测试过这个。 # A flag to notify the thread that it should finish up and exit [i*i for i in range(10000)]
threads = []Sending kill to threads..."for t in threa