title: Multiprocessing.apply on Python 3
body: <p>I have a function that is looping using values from a dictionary. I want to split my dict keys, so i can break my dict at parts equal to my cpus. My fucntion is:</p>
  
  <pre><code>def find_something2(new2, threl=2.0, my_limit=150, far=365):
  """ Find stocks tha are worth buying"""
  global current_date, total_money, min_date, current_name, dates_dict, mylist, min_date_sell, reduced_stocks
  worthing = list()
  for stock in new2:
      frame = reduced_stocks[stock]
      temp = frame.loc[current_date:end_date]
      if not temp.empty:
          mydate = temp.head(far).Low.idxmin()
          if mydate &lt;= min_date_sell:
              my_min = temp.head(far).Low.min()
              if total_money &gt;= my_min &gt; 0:  # find the min date at four months
                  ans, res, when_sell, total, income = worth_buy(stock, frame, mydate, 'Low',
                                                                 thres=threl, sell_limit=my_limit)
                  if ans:
                      if income &gt; 3 * 10 ** 6:
                          worthing.append([mydate, stock, res, when_sell, total, income])
  if current_date &gt; '1990-01-01':
      return sorted(worthing, key=itemgetter(0))
  elif current_date &gt; '1985-01-01':
      return sorted(worthing, key=itemgetter(0))
  else:
      answer = sorted(worthing, key=itemgetter(5), reverse=True)
      return answer[::11]
  </code></pre>
  
  <p>so what i have tried is:</p>
  
  <pre><code>import multiprocessing as mp
  result_list = []
  def log_result(result):
      # This is called whenever foo_pool(i) returns a result.
      # result_list is modified only by the main process, not the pool workers.
      global result_list
      result_list.append(result)
  def apply_async_with_callback():
      global reduced_stocks
      temp = list(reduced_stocks.keys())
      temp1 = temp[0:1991]
      temp2 = temp[1991:]
      temp = [temp1, temp2]
      pool = mp.Pool(2)
      for i in temp:
          pool.apply_async(find_something2, args=(i, 1.1, 2200, 1,), callback=log_result)
      pool.close()
      pool.join()
      print(result_list)
  
  if __name__ == '__main__':
          apply_async_with_callback()
  </code></pre>
  
  <p>is this the right way?</p>
  
  <p><strong>I also tried threads but cpu goes max at 15% althoug iam using 12 threads(i have 6 intel core)</strong></p>
  
  <pre><code>def pare():        
  relist = list(reduced_stocks.keys())
  sublist = [relist[x:x+332] for x in range(0, len(relist), 332)]  
  data = [x  for x in sublist]
  threads = list()
  from threading import Thread
  for i in range(12):
      process = Thread(target=find_something2, args=(1.4,2500,8,data[i],i,results))
      process.start()
      threads.append(process)
  for process in threads:
      process.join()
  </code></pre>