Use processor APIC ID and CPUID to detect hyperthreads, cores and sockets and store the information in corresponding `cpu_t` structures. Implement API to schedule tasks based on the topology information.