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.