class AnyOfThreadAffinityPolicy

Policy that returns affinity that allows a thread to execute on any of the cores provided to the policy.

On Windows returned affinity will return only cores from the same group, and the groups are give out depending on the provided thread index.

Public

Constructors

AnyOfThreadAffinityPolicy

AnyOfThreadAffinityPolicy(const ThreadCoreMask &availableCores)

Creates the policy with a list of cores that threads will be allowed to run on.

Methods

GetMaskForThread

ThreadCoreMask GetMaskForThread(u32 threadIndex) const override

Returns a mask that lets the caller know on which cores can the thread be executed on.

threadIndex
Index of the thread for which to determine affinity. It's best these are sequential so cores can be distributed in a round-robin fashion, for policies where that matters.

Returns: Returns mask that determines on which cores should the thread run on.

Private

Fields

mAvailableCores

ThreadCoreMask mAvailableCores