cpu /

Filename Size Date modified Message
71 B
90 B
1.5 KB
941 B
2.7 KB
3.8 KB
3.4 KB
468 B
1.1 KB
    cpu package reports processor topology

    currently reports (see main.go):
        - if the cpuid instruction is present
        - if cpuid execution is restricted
        - if Hyper-Threading Technology is supported
        - maximum number of processors supported by the OS
        - number of processors on line
        - Vendor name
        - report OS process count
        - report total package count
        - report total core count
        - report total thread count
        - report HTT per core count
        - report HTT per package count

    For multi-package systems the package count calculation
    probably isn't correct at the moment. It assumes that the
    physical package count can be derived by dividing the maximum
    processor count by the logical processor count of the package
    that the thread is running on, and that the configuration is

    The ideal way to calculate the package/core/thread count
    for multi-package systems is to iterate through the system
    by affinitizing the running thread, I'm working currently
    working on.

    A lot of this information can be derived on nix systems
    (linux?) using sysctl, examples:

    make install - builds and installs the package

    make main - builds and installs the package and creates the example file main

    see main.go

    see main.go

- Package refers to a physical processor that plugs in to a socket
- Core refers to a physical sub-system of a package. A core may contain 1 or more
  logical processors
- A logical processor refers to a hardware resource that can execute a single thread
- Hyperthreading refers to the technology that allows a processor core to provide the
  functionality of more than one logical core
- Simultaneous Multi-Threading refers to multiple logical processors within the same core
- Multi-Core Processor contains more than one physical core
- MultiProcessor Platform contains multiple physical sockets
- Hardware Multithreading refers to any combination of hardware support to allow
  multithreading, which could be any combination of SMT, multi-core, and multi-processor
- Processor Topology is the hierarchical relationship of shared vs dedicated hadrware resources

- add error enumerations
- handle non-windows systems that don't have _SC_NPROCESSORS_ONLN and _SC_NPROCESSORS_CONF
- if 64-bit, or newer 32-bit, and the leaf value is less than 4 check IA32_MISC_ENABLES bit 22