How does Java handle multithreading?

后端 未结 4 604
误落风尘
误落风尘 2020-12-19 17:01

How does Java decide which core to assign a thread or a process? Is there any way to control that? to prevent two large threads from executing on the same core?

Basi

4条回答
  •  梦毁少年i
    2020-12-19 17:50

    How does Java decide which core to assign a thread or a process?

    It doesn't. The operating system does.

    Is there any way to control that? to prevent two large threads from executing on the same core?

    Not within Java.

    Basically what I am asking is for further information on either how multi-threading works in Java, or how to control it within Java.

    There isn't any. It is all done by the OS.

    Basically you are asking the wrong question.

提交回复
热议问题