-
0 votesanswersviews
无论如何将python期货放入fifo?
我正在尝试将并行处理python脚本放在一起 . 它使用期货来执行重型处理任务,而主线程构建任务以供它们执行,并将它们放入 multiprocessing.Queue . 有's another process that deals with the results of futures(reading the results and compiling the final result). I... -
3 votesanswersviews
ThreadPoolExecutor中的worker不是真正的守护进程
我无法弄清楚的是,虽然 ThreadPoolExecutor 使用守护进程工作者,但即使主线程退出,它们仍会运行 . 我可以在python3.6.4中提供一个最小的例子: import concurrent.futures import time def fn(): while True: time.sleep(5) print("Hello&... -
1 votesanswersviews
为什么我不能在asyncio事件循环中使用concurrent.futures?
从asyncio文档中可以看出asyncio具有: “一个Future类,模仿concurrent.futures模块中的那个,但适用于事件循环;” 为什么标准库中需要有两个不同的Future类(在asyncio和并发中)?为什么有必要使它适应事件循环?我在这里缺少什么,或者是什么让他们这样决定?