title: 4 threads or 8, thread execution time is the same
body: <p>Initially I have (for example 2 000 000 lines of data to process)
  I have an <code>ArrayList&lt;ArrayList&lt;SubsData&gt;&gt; threads</code>.
  SubsData is a class.</p>
  
  <p>In the loop I fill the array according to given amount of threads number;
  So if I have more threads, then each ArrayList will have less data to process.</p>
  
  <p>Then here I pass array of data to certain thread and run it.
  `</p>
  
  <pre><code>for (int i = 0; i &lt; threads.size(); i++) 
  {
             ArrayList&lt;SubsData&gt; thread = threads.get(i);
             Worker w = hlrSockets.get(i);
             DButilities db = dbSockets.get(i);
             Collation performCollation = new Collation(thread,w, db);
             new Thread(performCollation, "collateThread #" + i).start();
  }
  </code></pre>
  
  <p>`</p>
  
  <p>But it doesn't matter if I run 8 or 16 threads, the thread execution time doesn't varies.</p>
  
  <ol>
  <li><em>Ok let's say I have 1 processor with 8 cores</em> <br/></li>
  <li><p><em>100 lines in ArrayList</em> <br/><strong>1 thread will process array within 1 minute</strong> <br/> </p></li>
  <li><p><em>Then I split 100 lines in two different ArrayList objects with 50 lines in each</em> <br/></p></li>
  <li>Pass these arrays to different threads</li>
  </ol>
  
  <p><strong>2 threads should process data in arrays within 30 seconds</strong> <br/> </p>
  
  <p>Am I right ?<br/>If I'm, then why it's not working in my case ?<br/>If you need any part of my code, I will post it here just shout
  I need to get rid of it</p>
  
  <p>Here is profiling results.
  Please check it out
  <a href="https://i.stack.imgur.com/fkU2I.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fkU2I.png" alt="Threads time line"></a></p>
  
  <p><a href="https://i.stack.imgur.com/RHBsI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RHBsI.png" alt="Locks and Threads 1"></a></p>
  
  <p><a href="https://i.stack.imgur.com/PPvFQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PPvFQ.png" alt="Locks and Threads 2"></a>
  <br/>
  Eventually, I found narrow place in my programm.<br/>
  It seems like from multiple threads Im reading from a single output stream.<br/></p>
  
  <p>When I comment the line readLine(), my programm runs twice, four times faster accoring to number of threads.<br/></p>
  
  <p>So the question is, what is wrong with this line ?<br/>
  I create BufferedReader inside a Thread, doesn't it suppose to be specific for each thread ?<br/></p>