Is there any API that could achieve a busy-wait for a certain duration, e.g. 500us, 1ms and etc?

Tadeus Prastowo 0x66726565@gmail.com
Wed Sep 9 08:14:13 GMT 2020


On Thu, Sep 3, 2020 at 3:33 AM 孙世龙 sunshilong via Libc-help
<libc-help@sourceware.org> wrote:
>>Resolution will vary depending on the underlying implementation e.g.
>>vDSO vs. syscall.

> How to verify which kind of underlying implementation is used by
> certain API(e.g. clock_gettime) on a specific platform?

I think you have asked the question on the other day
(https://sourceware.org/pipermail/libc-help/2020-July/005357.html and
https://sourceware.org/pipermail/libc-help/2020-August/005380.html),
the conclusion of which as far as I understand says that it cannot be
known for sure.

In that case, I think you don't have to perform the verification to
get the resolution.  Instead, you can perform some runtime
determination of the resolution when the application is started to
know the smallest resolution of the busy-wait that can be performed by
the application during runtime.

Hope this helps.

> Best regards
> Sunshilong

-- 
Best regards,
Tadeus


More information about the Libc-help mailing list