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


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.


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

  • 1
    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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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