Would a multithreaded Java application exploit a multi-core machine very well?

后端 未结 4 1842
慢半拍i
慢半拍i 2020-12-18 14:11

If I write a multi-threaded java application, will the JVM take care of utilizing all available cores? Do I have to do some work?

4条回答
  •  情歌与酒
    2020-12-18 14:52

    Unless you use a JVM that has so-called "green" threads (which is very few these days), Java threads are run by OS threads, so multiple threads get run on different cores by default.

提交回复
热议问题