title: Parallellize a for loop in Java using multi-threading
body: <p>I am very new to java and I want to parallelize a nested for loop using executor service or using any other method in java. I want to create some fixed number of threads so that CPU is not completely acquired by threads.</p>
  
  <pre><code>    for(SellerNames sellerNames : sellerDataList) {
          for(String selleName : sellerNames) {
          //getSellerAddress(sellerName)
          //parallize this task
          }
      }
  </code></pre>
  
  <p>size of sellerDataList = 1000 and size of sellerNames = 5000.</p>
  
  <p>Now I want to create 10 threads and assign equal chunk of task to each thread equally. That is for i'th sellerDataList, first thread should get address for 500 names, second thread should get address for next 500 names and so on.<br>
      What is the best way to do this job?</p>