title: javaw.exe high cpu usage
body: <p>I have created a runnable jar, which runs on a single thread. The thread executes a for loop having 100 iteration. However the cpu usgae goes upto 60% on i3 processor win7 64 bit machine.
  I tried to analyze the cpu usage in <a href="https://technet.microsoft.com/en-in/sysinternals/bb896653.aspx" rel="nofollow">process Explorer</a></p>
  
  <p>The native threads are consuming CPUs. 
  The native threads are all at msvcr100.dll!endthreadex+0x60
  consuming cpu
  I am using jdl 1.7.
  Can somebody please suggest what might be going wrong here. </p>
  
  <p>Here is the code:
  the app accepts socket connection and processes the  date sent by the client.</p>
  
  <pre><code>while (true)
  {
      try
      {
          Socket sock = ssock.accept();   
          // This is the function which has the for loop          
          obj.MyFunction();           
      }
      catch(Exception ex)
      {               
          ssock.close();
      }
      Thread.sleep(1000);
  }                   
  
  void MyFunction()
  {
      for(int i=0; i &lt; 1000;i++)
      {
           // Processing done here
      }
  }
  </code></pre>