software threads vs hardware threads

前端 未结 4 583
一向
一向 2020-12-12 12:32

What is the difference between software threads, hardware threads and java threads?

Are software threads, java threads and hardware threads independent or interdepen

4条回答
  •  囚心锁ツ
    2020-12-12 13:16

    Software threads are threads of execution managed by the operating system.

    Hardware threads are a feature of some processors that allow better utilisation of the processor under some circumstances. They may be exposed to/by the operating system as appearing to be additional cores ("hyperthreading").

    In Java, the threads you create maintain the software thread abstraction, where the JVM is the "operating system". Whether the JVM then maps Java threads to OS threads is the JVM's business (but it almost certainly does). And then the OS will be using hardware threads if they are available.

提交回复
热议问题