title: store results ThreadPoolExecutor
body: <p>I am fairly new to parallel processing with "concurrent.futures" and I am testing some simple experiments. The code I have written seems to work, but I am not sure how to store the results. I have tried to create a list ("futures") and append the results to that, but that considerably slow down the procedure. I am wondering if there is a better way to do that. Thank you.</p>
  
  <pre><code>import concurrent.futures
  import time
  
  couple_ods= []
  futures=[]
  
  dtab={}
  for i in range(100):
      for j in range(100):
         dtab[i,j]=i+j/2
         couple_ods.append((i,j))
  
  avg_speed=100
  def task(i):
      origin=i[0]
      destination=i[1]
      time.sleep(0.01)
      distance=dtab[origin,destination]/avg_speed
      return distance
  start1=time.time()
  def main():
      with concurrent.futures.ThreadPoolExecutor() as executor:
         for number in couple_ods:
            future=executor.submit(task,number)
            futures.append(future.result())
  
  if __name__ == '__main__':
      main()
  end1=time.time()
  </code></pre>