RtGetThreadCLOS

RtGetThreadCLOS retrieves the Class of Services (CLOS) value of a specified thread.

Syntax

Copy
BOOL RtGetThreadCLOS(
    HANDLE hThread,
    ULONG *pCLOS
);

Parameters

hThread

The Process thread handle whose CLOS value will be returned.

pCLOS

A pointer to a ULONG variable. It stores the thread’s explicit CLOS (if set by the user) or the implicit/default CLOS value.

Return Value

If the function succeeds, it returns TRUE. If the argument was invalid or if RDT is not supported or is disabled via GRUB boot entry settings, it returns FALSE.

Remarks

A thread has implicit/default CLOS which is based on its priority when the kernel is configured to use Priority-based CLOS performance mode. The implicit/default CLOS and priority are inversely mapped with the Process priority range (0~127) by the number of CLOS available to Process processors/cores. Use real-time function RtGetRDTCapability to determine the number of CLOS. With Flat performance mode the default CLOS is 0.

For example, the mapping table below is for the number of CLOS equal to 7.

CLOS Process Priority Range
0 109~127
1 90~108
2 72~89
3 54~71
4 36~53
5 18~35
6 0~17

The implicit/default CLOS of Process thread can be overwritten by RtSetThreadCLOS. When the thread is scheduled to run, its CLOS is used to guide the hardware’s LLC fill policy and memory throttling.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

RtssApi.h rtkrnl.lib

See Also: