Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to find out if hyperthreading is enabled within the BSD kernel of a given machine without watching the boot up sequence?

share|improve this question
This may help you. – Prince John Wesley Jul 1 '11 at 4:23
up vote 1 down vote accepted

There does not appear to be a way using sysctls to determine if a system has hyperthreading enabled or not. hw.ncpu will just inform the kernel how many CPUs are available which will include cores, hyperthreads, and individual processors.

Also, the link from Prince John Wesley is from 2006 and no longer appear relevant.

As much as I hate grepping dmesg, you can do the following (on FreeBSD 8.x):

dmesg | grep SMT

Hyperthreaded systems should return a result. Not hyperthreaded systems should not.

share|improve this answer

You can determine this by looking at the output of sysctl hw.ncpu. If it is 1, you have no hyperthreading.

share|improve this answer
But if it's >1, it could mean multiple cores, not necessarily hyperthreading. – Gilles Jun 30 '11 at 23:41
So 0 means HT is enabled? – Mark D Jul 2 '11 at 19:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.