Description
Optional host controls for reducing benchmark placement noise.
Pin_Current_Thread
function Pin_Current_Thread (CPU : Natural) return Placement_Strength
Pin or affinity-tag the calling native thread. Linux applies strict CPU affinity. Darwin applies a scheduler affinity tag, which is advisory and groups threads by cache affinity rather than naming a CPU; Apple Silicon implements no thread affinity at all and rejects every request, so placement there is unavailable rather than weak. Call this from the thread that will execute the benchmark.
Parameters
- CPU
Zero-based logical CPU or Darwin affinity tag index.
Return value
Strength of the applied platform policy.
Raised exceptions
- Program_Error
If the platform rejects the request.
Placement_Strength
type Placement_Strength is (Advisory, Strict);
Strength of the placement policy applied by the host.
Enumeration literals
- Advisory
Placement is a scheduler hint rather than a hard binding.
- Strict
The calling thread is bound to the selected logical CPU.