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

后端 未结 4 1839
慢半拍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:40

    On the flip of that, it is sometimes useful to "bound"/set affinity for a Java process to only use a set of cores/sockets, though done via OS semantics. As previously answered, most runtimes indeed employ all cpus and with highly threaded apps can eat up more resources than you might expect.

提交回复
热议问题