How java threads are scheduled?

前端 未结 4 2112
后悔当初
后悔当初 2021-01-06 09:00

I have recently started multi-threaded programming with Java in case of Linux threads , i know that the kernel schedules them(as they are the unit entities that are schedule

4条回答
  •  梦毁少年i
    2021-01-06 09:10

    The jvm is just a normal process which starts with one thread and can spawn as much threads it likes afterwards. Scheduling is done on two levels - between processes and between threads inside processes. All this is done by the OS (via libs) - the jvm just hooks in. Google posix threads for more details - thats whats exposed (API) to the jvm.

    This goes a bit into details: http://www.ibm.com/developerworks/java/library/j-rtj3/

提交回复
热议问题