cpu /

Filename Size Date modified Message
71 B
867 B
1.5 KB
528 B
2.4 KB
3.0 KB
6.2 KB
480 B
2.4 KB
Description
------------

    cpu package reports processor topology information

    Note that the term package refers to a physical processor
    and system refers to multiple packages. Also, a processor's
    hardware capability may differ from its configuration.

Usage
-----
    See main.go for output information and usage

Compiling
---------
    make          builds the package
    make install  builds and installs the package
    make example  builds, installs the package, and creates the example program

Testing
-------
    run the example program

TODO
----
- add error enumerations
- if 64-bit, or newer 32-bit, and the leaf value is less than 4 check IA32_MISC_ENABLES bit 22

Misc
----
- 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
- Hyper-threading 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 hardware resources

I'm currently working on code to enumerate through packages/cores/threads.
I do development commits to the bitbucket repo but I'll be sure to make
incremental tags for working code.

At some point the package name will probably change to something broader
like sys with the information items containing more detail, e.g. sys.CpuCnt.

At this point the code has only been tested on 64-bit OS X.

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
symmetrical.

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.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.