title: get result from multithread for the same method
body: <p>I would like to parallelize my program to be fast, so my program is like that: </p>
  
  <pre><code>  Sim1 sim1 = new Sim1();
      for(Entry&lt;Integer, HashSet&lt;String&gt;&gt; entry : map_topics_words.entrySet()) {              
                  Integer k = entry.getKey();
                  Double sim = sim1.prob(word_m, entry.getValue());           
                  sim_avg.put(k, sim);
                  score += sim;           
  } 
  </code></pre>
  
  <p>and prob in the method in class Sim1 like that </p>
  
  <pre><code>public double prob(String w_i, HashSet&lt;String&gt; set_i){  
      Similarity sim = new Similarity();
      double score = 1;
      Iterator&lt;String&gt; it = set_i.iterator();
      while (it.hasNext()) {
          score += sim.computeSim(w_i, it.next());            
      }
      score = score/set_i.size(); 
      return score;
  }
  </code></pre>
  
  <p>and computeSim in the method in classe Similarity like that : </p>
  
  <pre><code>public double computeSim(String w_1, String w_2){   
  return  cmp(w_1,w_2);
  }
  </code></pre>
  
  <p>So I would like to use thread for the first method and thread for the second method, I tried different ways but I failed
  Any help, please
  Thank you</p>