Skip to main content

Module threads

Module threads 

Source
Expand description

Thread-pinning helpers from AOCL-Utils.

These are very thin wrappers around the AOCL routines that take a list of OS-level thread handles (pthread_t on Unix, HANDLE on Windows) and pin them to physical or logical cores. Most callers collect pthread_t / HANDLE values from their thread library (std::thread::current().handle()-style accessors via os-specific crates) before invoking these.

The functions are unsafe because passing a thread handle that no longer refers to a live thread is undefined behavior on the AOCL side.

Enums§

PinStrategy
Pinning strategy for a list of thread handles.

Functions§

pin_threads
Pin the given thread handles using the chosen strategy.
pin_threads_custom
Pin threads with a custom mapping: affinity_vector[i] is the logical processor index thread i should bind to.

Type Aliases§

ThreadHandle
OS-native thread handle.