title: Running Multiple Threads
body: <p>I am using 1 thread for 2 tasks </p>
  
  <ol>
  <li>Reading file</li>
  <li><p>Download file</p>
  
  <pre><code>scheduledExecutorService1 = Executors.newScheduledThreadPool(1);
  </code></pre></li>
  </ol>
  
  <p>But with multiple files, there will be a delay per thread.</p>
  
  <p>Using the following code causes <em>duplicates</em>:</p>
  
  <pre><code>scheduledExecutorService1 = Executors.newScheduledThreadPool(2);
  </code></pre>
  
  <p>What will be the correct code to run with multiple threads handling delays and avoiding dulication.</p>