Answer: store results ThreadPoolExecutor

lamnguyenx profile image Lam Nguyen ・1 min read

When you call future.result(), that blocks until the value is ready. So, you’re not getting any benefits out of parallelism here—you start one task, wait for it to finish, start another, wait for it to finish, and so on.

Of course your example won’t benefit from threading in the…


Editor guide