老师您好,
_worker()方法中用了while True循环不停地从work_queue中取work_item,
想问下,什么情况下可以真正用到while True循环,具体点说,像如下这种情况,task1 = executor.submit(get_html, (3))会很快执行_worker(),task2 = executor.submit(get_html, (2))也是同样,为什么还需要在一个线程中不停循环取work_item呢? 谢谢
executor = ThreadPoolExecutor(max_workers=2)
task1 = executor.submit(get_html, (3))
task2 = executor.submit(get_html, (2))