qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] qemu-sem-posix: use monotonic clock instead
@ 2022-02-22  9:05 Longpeng(Mike) via
  2022-02-22  9:05 ` [PATCH v2 1/3] sem-posix: remove the posix semaphore support Longpeng(Mike) via
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Longpeng(Mike) via @ 2022-02-22  9:05 UTC (permalink / raw)
  To: pbonzini, berrange, mst
  Cc: qemu-devel, arei.gonglei, wangxinxin.wang, Longpeng(Mike)

The qemu_sem_timedwait() uses system time as default, it would be affected by
changes to the system time. In the real scenario, the time that goes faster or
slower is a common case and the NTP service could help us to sync time
periodically.

This patchset uses monotonic clock instead of the realtime clock, this could
make sure we would not be affected by the system time anymore.

Changes v1(RFC) -> v2:
 Patch 2:
  - clean the code [Paolo]
  - use pthread_condattr_setclock when initializing qemu-cond. [Paolo]
 Patch 3:
  - new added, make the qemu-sem code neater. [Longpeng]

Longpeng (Mike) (3):
  sem-posix: remove the posix semaphore support
  sem-posix: use monotonic clock instead
  sem-posix: refactor qemu-sem with qemu-cond and qemu-mutex

 include/qemu/thread-posix.h |   9 +--
 meson.build                 |  12 ++-
 util/qemu-thread-posix.c    | 178 +++++++++++++++-----------------------------
 3 files changed, 73 insertions(+), 126 deletions(-)

-- 
1.8.3.1



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

end of thread, other threads:[~2022-02-23 10:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22  9:05 [PATCH v2 0/3] qemu-sem-posix: use monotonic clock instead Longpeng(Mike) via
2022-02-22  9:05 ` [PATCH v2 1/3] sem-posix: remove the posix semaphore support Longpeng(Mike) via
2022-02-22  9:05 ` [PATCH v2 2/3] sem-posix: use monotonic clock instead Longpeng(Mike) via
2022-02-22  9:05 ` [PATCH v2 3/3] sem-posix: refactor qemu-sem with qemu-cond and qemu-mutex Longpeng(Mike) via
2022-02-23  9:39 ` [PATCH v2 0/3] qemu-sem-posix: use monotonic clock instead Paolo Bonzini

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