在 2026-9-12 22:24, Kirill Makurin 写道:
Hello,

When I was getting more familiar with winpthreads' source code back in May, 
wrappers `_pthread_wait_for_single_object` and 
`_pthread_wait_for_multiple_objects ` caught my attention. They were added in 
this commit[1].

How bad is precision of `WaitForSingleObject` and `WaitForMultipleObjects `? 
They accept timeout in milliseconds; `SYSTEMTIME` supports millisecond 
resolution; `FILETIME` uses sub-microsecond resolution (if converted from 
`SYSTEMTIME`, sub-millisecond part is likely lost); so how bad can it be? I 
assume it may be the case for older Windows versions or old hardware?

I'm simply curious and by no means I suggest that we remove them.

By default the granularity is 15-16 milliseconds; so if you request one millisecond, it usually takes 15-16 milliseconds, and intermittently up to 40 milliseconds.

The granularity can be decreased with `timeBeginPeriod()`, down to one 
millisecond.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to