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.