![]() ![]() A wait function like WaitForSingleObject() can wait for an event. Sleep(0) is an asynchronous service, the call will force the scheduler to react independent of an interrupt.Ī second way is the use of a waitable object. This way the thread will stop until the scheduler forces the thread to get cpu service again. ![]() Tool and it is not used as often as it should! It relinquishes the reminder of the thread's time slice. There is one exception wich allows us to escape from the fact that it may be impossible to sleep for less than the interrupt period: It is the famous Sleep(0). They just can't put the correct number into the ActualResolution format. It may be set to something close toġ ms, some hardware even allows to run at interrupt periods of 0.9765625 ( ActualResolution provided by NtQueryTimerResolution will show 0.9766 but that's actually wrong. However, thisĭepends on settings of the multimedia timer resources. Generally a sleep will last at least until the next system interrupt occurs.
0 Comments
Leave a Reply. |