public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* sem_timedwait: The semaphore times out when the clock_REALTIME is used.
@ 2021-04-06 13:09 y00575850
  2021-04-08 14:10 ` Szabolcs Nagy
  0 siblings, 1 reply; 2+ messages in thread
From: y00575850 @ 2021-04-06 13:09 UTC (permalink / raw)
  To: libc-stable; +Cc: wuxu.wu, carlos

	Dear Carlos,
When I use sem_timedwait, a time jump will cause the semaphore to time out. 
While I know that using CLOCK_REALTIME is POSIX-defined behavior, it doesn't 
fit the actual meaning of this function.To solve this problem, modify the 
sem_timedwait process, for example: add a switch control. 
Or add an interface that uses the Clock_MONOTONIC interface.

Best regards,
Yanchao

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

* Re: sem_timedwait: The semaphore times out when the clock_REALTIME is used.
  2021-04-06 13:09 sem_timedwait: The semaphore times out when the clock_REALTIME is used y00575850
@ 2021-04-08 14:10 ` Szabolcs Nagy
  0 siblings, 0 replies; 2+ messages in thread
From: Szabolcs Nagy @ 2021-04-08 14:10 UTC (permalink / raw)
  To: y00575850; +Cc: libc-stable, carlos, wuxu.wu

The 04/06/2021 21:09, y00575850 via Libc-stable wrote:
> 	Dear Carlos,
> When I use sem_timedwait, a time jump will cause the semaphore to time out. 
> While I know that using CLOCK_REALTIME is POSIX-defined behavior, it doesn't 
> fit the actual meaning of this function.To solve this problem, modify the 
> sem_timedwait process, for example: add a switch control. 
> Or add an interface that uses the Clock_MONOTONIC interface.

this is the wrong list.

you don't seem to understand the interface contract of sem_timedwait,
it cannot change the used clock.

glibc has non-standard apis to wait with different clock
https://www.gnu.org/software/libc/manual/html_node/Waiting-with-Explicit-Clocks.html

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

end of thread, other threads:[~2021-04-08 14:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 13:09 sem_timedwait: The semaphore times out when the clock_REALTIME is used y00575850
2021-04-08 14:10 ` Szabolcs Nagy

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 read-only IMAP folder(s) and NNTP newsgroup(s).