Training
×

System Calls: Thread Control

The system clock ticks at 10 millisecond intervals so dwWaitTime is rounded to be a multiple of this interval (we will see that there is also a faster ticking clock).
A thread cannot put another thread to sleep. When an asleep thread awakens, it is put into the ready list according to its priority.
Do not use RtSleep as a precision delay. The amount of time the thread is asleep depends on when in the clock tick cycle (clock interrupt interval) the call is issued; when it wakes up, it may not run immediately, depending on other threads in the ready list.
A thread cannot set its priority better (numerically lower) than allowed by the process that contains the thread (more on this later).