Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
gevent python3.7 + ThreadPoolExecutor block main thread #1251
gevent + python3.7 + ThreadPoolExecutor will block main thread forever while running future.result(). seems like something about _thread.allocate_lock.acquire.
only python3.7 hit that issue
What I've run:
from gevent import monkey monkey.patch_all() from concurrent.futures import ThreadPoolExecutor import requests pool = ThreadPoolExecutor() task = pool.submit(requests.get, "http://python.org") task.add_done_callback(lambda r: print(r.result(), 'done')) print(task.result())
<Response > done