public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] c2y proposal add monotonicwait support for mtx and ctx
@ 2023-06-19 22:20 Yonggang Luo
  2023-06-19 22:20 ` [PATCH 1/5] features: Rename __GLIBC_USE_ISOC2X to __GLIBC_USE_ISOC23 Yonggang Luo
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Yonggang Luo @ 2023-06-19 22:20 UTC (permalink / raw)
  To: Jens Gustedt, libc-alpha; +Cc: Yonggang Luo

Currently the c11 threads mtx and cnd only support for mtx_timedlock
and cnd_timedwait that use TIME_UTC, and it's not monotonic, for application
want monotonic wait/lock, then they can not use c11 threads,
So here I proposaled functions:
int mtx_timedlock_monotonic( mtx_t *restrict mutex,
                             const struct timespec *restrict time_point );
int cnd_timedwait_monotonic( cnd_t* restrict cond, mtx_t* restrict mutex,
                             const struct timespec* restrict time_point );

to support monotonic lock/wait for mtx/cnd .

Yonggang Luo (5):
  features: Rename __GLIBC_USE_ISOC2X to __GLIBC_USE_ISOC23
  time: Implement c23 timespec_get base
  clang-format: should format with 2 space and do not usage tab
  c11: Switch to use pthread_mutex_clocklock and pthread_cond_clockwait
    to implement cnd and mtx lock and wait
  c2y: Add function cnd_timedwait_monotonic and mtx_timedlock_monotonic

 .clang-format                                 |   4 +-
 conform/data/threads.h-data                   |   2 +
 include/features.h                            |   4 +-
 nptl/Versions                                 |   5 +
 sysdeps/pthread/Makefile                      |   2 +
 sysdeps/pthread/cnd_timedwait.c               |   8 +-
 ..._timedwait.c => cnd_timedwait_monotonic.c} |  58 +++++-----
 sysdeps/pthread/mtx_timedlock.c               |   6 +-
 ..._timedlock.c => mtx_timedlock_monotonic.c} |  56 +++++-----
 sysdeps/pthread/threads.h                     |  16 +++
 sysdeps/unix/sysv/linux/Versions              |   6 ++
 sysdeps/unix/sysv/linux/cnd_timedwait.c       |   4 +-
 ..._timedwait.c => cnd_timedwait_monotonic.c} |  18 ++--
 sysdeps/unix/sysv/linux/mtx_timedlock.c       |   4 +-
 ..._timedlock.c => mtx_timedlock_monotonic.c} | 100 +++++++++---------
 sysdeps/unix/sysv/linux/thrd_priv.h           |   8 ++
 time/time.h                                   |  13 +++
 time/timespec_get.c                           |  48 ++++++++-
 18 files changed, 228 insertions(+), 134 deletions(-)
 copy sysdeps/pthread/{cnd_timedwait.c => cnd_timedwait_monotonic.c} (70%)
 copy sysdeps/pthread/{mtx_timedlock.c => mtx_timedlock_monotonic.c} (75%)
 copy sysdeps/unix/sysv/linux/{cnd_timedwait.c => cnd_timedwait_monotonic.c} (68%)
 copy sysdeps/unix/sysv/linux/{mtx_timedlock.c => mtx_timedlock_monotonic.c} (59%)

-- 
2.39.0.windows.1


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

end of thread, other threads:[~2023-06-21  6:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 22:20 [PATCH 0/5] c2y proposal add monotonicwait support for mtx and ctx Yonggang Luo
2023-06-19 22:20 ` [PATCH 1/5] features: Rename __GLIBC_USE_ISOC2X to __GLIBC_USE_ISOC23 Yonggang Luo
2023-06-20 20:21   ` Joseph Myers
2023-06-21  6:32     ` 罗勇刚(Yonggang Luo)
2023-06-19 22:20 ` [PATCH 2/5] time: Implement c23 timespec_get base Yonggang Luo
2023-06-20 12:44   ` Florian Weimer
2023-06-20 16:10     ` 罗勇刚(Yonggang Luo)
2023-06-20 20:25   ` Joseph Myers
2023-06-19 22:20 ` [PATCH 3/5] clang-format: should format with 2 space and do not usage tab Yonggang Luo
2023-06-19 22:20 ` [PATCH 4/5] c11: Switch to use pthread_mutex_clocklock and pthread_cond_clockwait to implement cnd and mtx lock and wait Yonggang Luo
2023-06-20  9:15   ` Florian Weimer
2023-06-19 22:20 ` [PATCH 5/5] c2y: Add function cnd_timedwait_monotonic and mtx_timedlock_monotonic Yonggang Luo
2023-06-20 20:29   ` Joseph Myers

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).