Infinite loop and CPU usage on single core and multicore : <p>Interviewer has asked me this question and I want to understand concept ie how CPU usages varies :</p>

<p>1) If infinite loop is running in single-threaded design with single core machine </p>

<p>2) If infinite loop is running in single-threaded design with multi-core machine ( 4 core )</p>

<p>3) If infinite loop is running in multi-threaded design with single core machine </p>

<p>4)If infinite loop is running in multi-threaded design with multi-core machine (4 core )</p>

<p>5) What will happen when application is having more threads then hardware core. For ex : Application is creating 30 threads in 4 core machine. Will it increase the performance of application or decrease the performance ?</p>

<p>6)  What will happen when application is having less threads then hardware core. For ex : Application is creating 5 threads in 4 core machine. Will it increase the performance of application or decrease the performance ?</p>

<p>Requesting you to explain the concepts so that things are clear. I have lot of confusion. </p>
