Thread priority setting in Windows CE

Source: Internet
Author: User

Windows CE selects the thread to run based on the priority setting. A thread with a higher priority will be scheduled more preferentially than a thread with a lower priority. The wince system supports 0 ~ 255 a total of 256 priority levels, of which 0 is the highest priority, 255 is the lowest priority, 0 ~ 248 is a real-time priority. The priority levels of threads in the wince system are as follows:
0 ~ 96: threads of highly real-time applications
97 ~ 152: Driver thread
153 ~ 247: low real-time application thread
248 ~ 255: threads of non-real-time applications

The Embedded Board of the arm9-system provided by yingchuang is pre-installed with the wince 5.0 kernel. The drivers of commonly used communication interfaces are also set based on the above priority levels.
101: USB keyboard
103: serial port driver
109: Touch key
116: NDIS (network)

Createthread (...) The default priority of the Application Thread created by the function is 251, that is, thread_priority_normal. If you need to adjust the thread priority, you can call the corresponding function to operate. To set and obtain the priority of a thread, you can call the cesetthreadpriority function and the cegetthreadpriority function. These two functions are available for all 256 priorities. Note that two other functions can also be used: the setthreadpriority function and the getthreadpriority function. However, they can only set or obtain the lowest eight priorities, namely, 248 ~ 255. These eight priorities correspond to the eight priorities of earlier versions of wince.

Related Article

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.