Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hardware thread vs soft threads?

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 ?

like image 203
Bhadri Avatar asked Apr 08 '11 09:04

Bhadri


1 Answers

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.

like image 109
Tony The Lion Avatar answered Nov 04 '22 11:11

Tony The Lion