> > While this makes sense for POSIX, non-POSIX systems only implementing > commonly used functions might not have nanosleep. Windows (neither via > mingw32 nor mingw64) doesn't seem to have nanosleep. If we go for this, we > need a fallback for such systems. >
WinAPI provides Sleep() function which gets milliseconds as argument. However giving small values for this function doesn't mean that system turns back control to calling thread within requested timeout. Sure the sleeps functions doesn't intended for that but there another problem on Windows - kernel scheduler works with greater time intervals by default. Multimedia applications mostly calls special function timeEndPeriod<http://msdn.microsoft.com/en-us/library/dd757626%28v=vs.85%29.aspx>() at application start. Its generally controls resolution for 'multimedia timers' but developers notify that this function affect the whole system and on Sleep() calls too provide the better sleeping precision (from ~50 milliseconds up to 1 millisecond). So generally nanosleep() analog cannot be provided on Windows system at all due to Windows kernel specific behaviour (and even using Sleep() in milliseconds you can obtain inexplicable behaviour if using ultra-small time intervals without configuring 'multimedia timers'). ----------------------------------------------- Kirill Gavrilov, Software designer. <[email protected]>
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
