My System is 7 core CPU machine. I just tried running the below program
for(int i=0;i<10; i++)
{
new Thread(new Runnable()
{
@Override
public void run()
{
while (true)
{
}
}
}).start();;
}
Now my full CPU usage is 100%(7 cores are 100%). Here 10 threads are in single Process javaw.exe. How it got split across all of my CPU cores?
Whether a single process can run in multiple cores or whether java implementation take care of giving threads across different processors?