Export (0) Print
Expand All

JOBOBJECT_CPU_RATE_CONTROL_INFORMATION structure

Contains CPU rate control information for a job object. This structure is used by the SetInformationJobObject and QueryInformationJobObject functions with the JobObjectCpuRateControlInformation information class.

Syntax


typedef struct _JOBOBJECT_CPU_RATE_CONTROL_INFORMATION {
  DWORD ControlFlags;
  union {
    DWORD CpuRate;
    DWORD Weight;
  };
} JOBOBJECT_CPU_RATE_CONTROL_INFORMATION, *PJOBOBJECT_CPU_RATE_CONTROL_INFORMATION;

Members

ControlFlags

The scheduling policy for CPU rate control. This member can be one of the following values.

ValueMeaning
JOB_OBJECT_CPU_RATE_CONTROL_ENABLE
1

This flag enables the job's CPU rate to be controlled based on weight or hard cap. It must be set if JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED or JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP is set.

JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED
2

The job's CPU rate is calculated based on its relative weight to the weight of other jobs. If this flag is set, the Weight member contains more information. If this flag is clear, the CpuRate member contains more information.

JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP
4

The job's CPU rate is a hard limit. After the job reaches its CPU cycle limit for the current scheduling interval, no threads associated with the job will run until the next interval.

JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY
8

The system will send a JOB_OBJECT_MSG_NOTIFICATION_LIMIT message to the job's I/O completion port if the job exceeds the CPU rate control limits specified in this structure within the tolerance specified in the JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION structure.

 

CpuRate

Specifies the percentage of processor cycles that can be used by threads in a job object during each scheduling interval. If the ControlFlags member specifies JOB_OBJECT_CPU_RATE_WEIGHT_BASED, this member is not used.

CpuRate should be set to percentage * 100. For example, if you want 20% cpu usage, you should set it to 20 * 100.

CpuRate should not be set to 0. If CpuRate is set to 0, SetInformationJobObject will return INVALID_ARGS.

Weight

If the ControlFlags member specifies JOB_OBJECT_CPU_RATE_WEIGHT_BASED, this member specifies the scheduling weight of the job object, which determines the share of processor time given to the job relative to other workloads on the processor. This member can be a value from 1 through 9, where 1 is the smallest share and 9 is the largest share. The default is 5, which should be used for most workloads.

Remarks

CPU rate control can be set for only one job in a hierarchy of nested jobs. The settings apply to the job and its child jobs in the hierarchy; they do not apply to the parent job chain. Settings can be changed for the original job, but attempts to set CPU rate control for any other job in the hierarchy (including parent jobs) will fail.

CPU rate control cannot be used by job objects in applications running under Remote Desktop Services (formerly Terminal Services) if Dynamic Fair Share Scheduling (DFSS) is in effect.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

WinNT.h

See also

JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
QueryInformationJobObject
SetInformationJobObject

 

 

Community Additions

ADD
Show:
© 2014 Microsoft