How Java multi-threaded program is able to use multiple CPU cores?

后端 未结 4 1478
失恋的感觉
失恋的感觉 2020-12-24 03:18

Could someone please provide explanation how Java multi-threaded program (e.g. Tomcat servlet container) is able to use all cores of CPU when JVM is only single process on l

4条回答
  •  北海茫月
    2020-12-24 03:43

    The JVM is a single process with many threads. Each thread can be scheduled on a different CPU core. A single process can have many threads.

    When Java software running inside the JVM asks for another thread the JVM starts another thread.

    That is how the JVM manages to use multiple cores.

提交回复
热议问题