Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how windows JobObject set limit on cpu usage?

Windows OS provides JobObject to limit the cpu usage of a process, but I’m wondering if the cpu portion takes account of kernel-space cpu usage or it is just user-space cpu usage? The documents doesn’t provides any clue.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Windows Job Objects can limit both user-mode and kernel-mode CPU usage of a process. When a process calls a system function that transitions into kernel mode, the kernel-mode CPU time used by that process is also counted towards its overall CPU usage.

According to Microsoft’s documentation, when you set a CPU rate limit using a Job Object, it applies to "both user-mode CPU time and kernel-mode CPU time that is associated with the process." Therefore, the limit applies to both user-mode and kernel-mode CPU usage.

It is important to note that setting a CPU rate limit using a Job Object is not a precise way to limit CPU usage, since it relies on statistical sampling and the accuracy of the CPU time measurements. In some cases, the actual CPU usage of a process may exceed the limit set by the Job Object due to factors such as system load and context switching.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading