Is it possible to check in Java if the CPU is hyper threading?
问题 I would like to know the optimal number of threads I can run. Normally, this equals to Runtime.getRuntime().availableProcessors() . However, the returned number is twice as high on a CPU supporting hyper threading. Now, for some tasks hyper threading is good, but for others it does nothing. In my case, I suspect, it does nothing and so I wish to know whether I have to divide the number returned by Runtime.getRuntime().availableProcessors() in two. For that I have to deduce whether the CPU is