How to determine the number of hardware threads

What is meant by hardware thread. Does the number of processor cores always double? How to determine the number of hardware threads in an Intel Core2 Duo processor? Can this be determined using Java code?

+5
source share
3 answers

What is meant by hardware thread.

Tell us. This is not a valid deadline.

Does the number of processor cores always double?

And now it seems that you are talking about hyperthreading , where partial redundancies in the processor core are used to "fake" the additional core.

Intel Core2 Duo ? Java-?

- , (.. JVM ).

(4 8 - , ) .

+5

, - AMD - (), BIOS ( , pre-nehalem, ). , ​​- Power7 4 ​​.

- OS- - . , , , hardware locality (hwloc). C-, Java.

+3

, . :

int N_CPUS = Runtime.getRuntime(). availableProcessors();

Using this value, you can determine how many threads should exist in the thread pool if you plan to implement it. To learn more about thread pool size, you can in Java in Concurrency, section 8.2.

+1
source

All Articles