Windows Dev Center

EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

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
0x1

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
0x2

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
0x4

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.

 

CpuRate

Specifies the portion of processor cycles that the threads in a job object can use during each scheduling interval, as the number of cycles per 10,000 cycles. 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 to let the job use 20% of the CPU, you should set CpuRate to 20 * 100.

Do not set CpuRate to 0. If CpuRate is 0, SetInformationJobObject returns 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

 

 

Ajouts de la communauté

AJOUTER
Afficher:
© 2015 Microsoft