From: Jan Kiszka <jan.kiszka@siemens.com>
To: malc <av1474@comtv.ru>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v3 01/10] Introduce qemu_cond_timedwait for POSIX
Date: Thu, 05 Apr 2012 15:24:59 +0200 [thread overview]
Message-ID: <4F7D9D2B.905@siemens.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1204051719350.2289@linmac>
On 2012-04-05 15:20, malc wrote:
> On Thu, 5 Apr 2012, Jan Kiszka wrote:
>
>> On 2012-04-05 15:00, malc wrote:
>>> On Thu, 5 Apr 2012, Jan Kiszka wrote:
>>>
>>>> On 2012-04-05 14:56, Paolo Bonzini wrote:
>>>>> Il 05/04/2012 14:53, malc ha scritto:
>>>>>> On Thu, 5 Apr 2012, Paolo Bonzini wrote:
>>>>>>
>>>>>>> Il 05/04/2012 14:30, malc ha scritto:
>>>>>>>>>> Would save that "* 1000". I just wondered why we do not use it elsewhere
>>>>>>>>>> in QEMU and was reluctant to risk some BSD breakage.
>>>>>>>>>>
>>>>>>>> It's probably worth mentioning that using anything other than
>>>>>>>> clock_gettime and CLOCK_MONOTONING (as well as setting proper pthread
>>>>>>>> clock attr on the condition variable) is prone to the surprises (such
>>>>>>>> as NTP corrections and daylight saving changes).
>>>>>>>
>>>>>>> I was about to suggest the same, but how widespread is support for
>>>>>>> pthread_condattr_setclock?
>>>>>>
>>>>>> If it's not all is lost anyway.
>>>>>
>>>>> Only once every year. :)
>>>>
>>>> ...and not for the current user of this service which do not care that
>>>> much about the timeout and a potential delay or early shot.
>>>>
>>>
>>> An hour of potential delay mind you.
>>
>> Nope, look at posix-aio-compat. It's an optimization to keep the number
>> worker threads under control.
>
> The code attempts to sleep for ten seconds, which can turn into an hour
> and ten seconds if the conditions are right.
Yes, but look at what happens then: it is unlikely that the thread will
stay idle so long on a busy system (some request will wake it up earlier
again), and even if that happens, the thread will simply consume a few
resources "a bit" longer.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-04-05 13:25 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 10:59 [Qemu-devel] [PATCH v3 00/10] Use more central threading and synchronization services Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 01/10] Introduce qemu_cond_timedwait for POSIX Jan Kiszka
2012-04-05 11:19 ` Peter Maydell
2012-04-05 11:56 ` Jan Kiszka
2012-04-05 12:15 ` Peter Maydell
2012-04-05 12:30 ` malc
2012-04-05 12:37 ` Paolo Bonzini
2012-04-05 12:53 ` malc
2012-04-05 12:56 ` Paolo Bonzini
2012-04-05 12:59 ` Jan Kiszka
2012-04-05 13:00 ` malc
2012-04-05 13:03 ` Jan Kiszka
2012-04-05 13:20 ` malc
2012-04-05 13:24 ` Jan Kiszka [this message]
2012-04-05 13:37 ` malc
2012-04-05 12:59 ` malc
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 02/10] Switch POSIX compat AIO to QEMU abstractions Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 03/10] Switch compatfd to QEMU thread Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 04/10] qemu-thread: Factor out qemu_error_exit Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 05/10] Introduce QemuEvent abstraction Jan Kiszka
2012-04-05 11:23 ` Paolo Bonzini
2012-04-05 12:20 ` Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 06/10] Use QemuEvent in main loop Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 07/10] Drop unused qemu_eventfd Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 08/10] Use QemuEvent for POSIX AIO Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 09/10] virtio: Switch to QemuEvent Jan Kiszka
2012-04-05 10:59 ` [Qemu-devel] [PATCH v3 10/10] Remove EventNotifier Jan Kiszka
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=4F7D9D2B.905@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=aliguori@us.ibm.com \
--cc=av1474@comtv.ru \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).