Hardware thread vs soft threads?

孤者浪人 提交于 2021-02-07 12:53:19

问题


I have read that in a multi core processor each core contains 2 hardware threads for example in dual core processor 4 hardware threads are running. Now if i create 2 threads in java are those threads going to map with 2 hardware threads or those 2 java threads are executed by single hardware thread of a particular core ?


回答1:


That is dependent on a lot of things, however the 2 hardware threads per core you are referring to is the Intel HyperThreading technology. This technology enables the CPU to have two Thread Context's in memory and be executing simultaneously, sharing execution resources.

What threads run where is OS implemention dependent and mostly resolved by the Thread Scheduler algorithm of your OS.



来源:https://stackoverflow.com/questions/5592871/hardware-thread-vs-soft-threads

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!