Skip to content
CodeKruPro

ThreadPoolExecutor: map and submit

QuizEasy-MediumPython only

A ThreadPoolExecutor runs tasks on a pool (a fixed group) of reusable threads. A Future is a handle to a result that is not ready yet. Which statements about concurrent.futures.ThreadPoolExecutor are true? Pick all that apply.

  • list(ex.map(fn, items)) returns results in the same order as items
  • ex.submit(fn, arg) returns a Future whose result() waits for the value
  • Leaving a with ThreadPoolExecutor() as ex: block waits for submitted tasks to finish
  • It runs CPU-heavy Python code on all cores at once

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in