Process occupies hundred percent CPU without card

Source: Internet
Author: User

In the writing program. In order to make the program high efficiency. Sometimes it's a bit high CPU. The user experience here is not good enough to set the thread priority to take care of.

BOOL setthreadpriority (
HANDLE hthread,//HANDLE to the thread
int npriority//thread priority level
);
function Description
sets the priority of the specified thread
parameter Description
Hthread the thread handle to set
npriority Priority parameter can be set to parameter
Thread_priority_above_normal one rank higher than the general priority
Thread_priority_below_normal is one grade lower than the average
thread_priority_highest 2 levels higher than normal
Thread_priority_idle//This value has a good priority. The user experience is better. System IDLE process is using this.
thread_priority_lowest 2 levels lower than normal
Thread_priority_normal General Grade
thread_priority_time_critical

SetThreadPriority (GetCurrentThread (),thread_priority_idle ); OK.

Process occupies hundred percent CPU without card

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.