From: "Longpeng(Mike)" via <qemu-devel@nongnu.org>
To: <pbonzini@redhat.com>, <berrange@redhat.com>, <mst@redhat.com>
Cc: <qemu-devel@nongnu.org>, <arei.gonglei@huawei.com>,
<wangxinxin.wang@huawei.com>,
"Longpeng(Mike)" <longpeng2@huawei.com>
Subject: [PATCH v2 0/3] qemu-sem-posix: use monotonic clock instead
Date: Tue, 22 Feb 2022 17:05:03 +0800 [thread overview]
Message-ID: <20220222090507.2028-1-longpeng2@huawei.com> (raw)
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
next reply other threads:[~2022-02-22 9:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 9:05 Longpeng(Mike) via [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220222090507.2028-1-longpeng2@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=arei.gonglei@huawei.com \
--cc=berrange@redhat.com \
--cc=longpeng2@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=wangxinxin.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).