software threads vs hardware threads

前端 未结 4 605
一向
一向 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 12:53

    Hardware threads can be thought of as the CPU cores, although each core can run multiple threads. Most of the CPUs mention how many threads can be run on each core (on linux, lscpu command gives this detail). These are the number of cores that can be used in parallel.

    Software threads are abstraction to the hardware to make multi-processing possible. If you have multiple software threads but there are not multiple resources then these software threads are a way to run all tasks in parallel by allocating resources for limited time(or using some other strategy) so that it appears that all threads are running in parallel. These are managed by the operating system. Java thread is an abstraction at the JVM level.

提交回复
热议问题