linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What clocks are supported by pthread_clockjoin_np()
@ 2020-11-19  8:42 Michael Kerrisk (man-pages)
  2020-11-19 12:00 ` Mike Crowe
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-11-19  8:42 UTC (permalink / raw)
  To: Mike Crowe; +Cc: linux-man, libc-alpha

Hi Mike,

I was looking at adding manual page documentation for
pthread_clockjoin_np(), but it's not clear to me from the code what
clocks are supported by the API, and the glibc info docs seem to be
silent on this point. What clocks are supported?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: What clocks are supported by pthread_clockjoin_np()
  2020-11-19  8:42 What clocks are supported by pthread_clockjoin_np() Michael Kerrisk (man-pages)
@ 2020-11-19 12:00 ` Mike Crowe
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Crowe @ 2020-11-19 12:00 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, libc-alpha

On Thursday 19 November 2020 at 09:42:07 +0100, Michael Kerrisk (man-pages) wrote:
> I was looking at adding manual page documentation for
> pthread_clockjoin_np(), but it's not clear to me from the code what
> clocks are supported by the API, and the glibc info docs seem to be
> silent on this point. What clocks are supported?

That's an interesting question. My intention was that it would support
CLOCK_REALTIME and CLOCK_MONOTONIC just like pthread_cond_clockwait,
sem_clockwait etc.

However, since the current implementation currently just calls
clock_gettime to calculate a relative timeout to pass to futex it will work
with any clock that clock_gettime supports.

Perhaps we ought to document pthread_clockjoin_np as supporting only
CLOCK_REALTIME and CLOCK_MONOTONIC and then change the implementation to
fail with EINVAL on any other clocks? Doing this means that the
implementation can switch to passing an absolute timeout to futex in the
future, which would mean that warping of CLOCK_REALTIME would be honoured
correctly by the kernel (although it's not clear to me how important that
really is to anyone.)

Thanks.

Mike.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-19 12:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19  8:42 What clocks are supported by pthread_clockjoin_np() Michael Kerrisk (man-pages)
2020-11-19 12:00 ` Mike Crowe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).