qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Arun R Bharadwaj <arun@linux.vnet.ibm.com>
Subject: [Qemu-devel] Re: [PATCH 1/3] Introduce threadlets
Date: Fri, 15 Oct 2010 16:42:27 +0200	[thread overview]
Message-ID: <4CB86853.9060408@redhat.com> (raw)
In-Reply-To: <AANLkTinwm5d9PRi2-BRnm3TSmuZe9SF7JBVnPZwWZfHD@mail.gmail.com>

On 10/14/2010 11:02 AM, Stefan Hajnoczi wrote:
> 2. Moving qemu_cond_signal() outside queue->lock is dangerous for the
> same reason: you need to be careful not to qemu_cond_signal() when the
> thread isn't inside qemu_cond_timedwait()."

Yes, please do so.

I personally consider it bad programming practice to put the condvar 
signal/broadcast outside the mutex.  While I understand that my ideas 
may not matter much, some Mr. Hoare actually invented them without 
signal-outside-lock, and he probably knows better than anyone reading.

Paolo

  parent reply	other threads:[~2010-10-15 14:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-13 15:30 [Qemu-devel] v5 [PATCH 0/3] qemu: Threadlets: A generic task offloading framework Arun R Bharadwaj
2010-10-13 15:31 ` [Qemu-devel] [PATCH 1/3] Introduce threadlets Arun R Bharadwaj
2010-10-14  9:02   ` Stefan Hajnoczi
2010-10-14 21:17     ` Venkateswararao Jujjuri (JV)
2010-10-15  9:52       ` Stefan Hajnoczi
2010-10-15 14:56         ` Venkateswararao Jujjuri (JV)
2010-10-15 14:42     ` Paolo Bonzini [this message]
2010-10-14  9:15   ` Stefan Hajnoczi
2010-10-14  9:19     ` Gleb Natapov
2010-10-14 16:16     ` Avi Kivity
2010-10-14 21:32       ` Venkateswararao Jujjuri (JV)
2010-10-17  8:57         ` Avi Kivity
2010-10-18 10:47           ` Arun R Bharadwaj
2010-10-18 12:29             ` Avi Kivity
2010-10-15  8:05       ` Stefan Hajnoczi
2010-10-13 15:31 ` [Qemu-devel] [PATCH 2/3] Make paio subsystem use threadlets Arun R Bharadwaj
2010-10-13 15:31 ` [Qemu-devel] [PATCH 3/3] Add helper functions for virtio-9p to " Arun R Bharadwaj
  -- strict thread matches above, loose matches on Subject: below --
2010-10-19 17:42 [Qemu-devel] v6: [PATCH 0/3]: Threadlets: A generic task offloading framework Arun R Bharadwaj
2010-10-19 17:42 ` [Qemu-devel] [PATCH 1/3] Introduce threadlets Arun R Bharadwaj
2010-10-19 18:36   ` Balbir Singh
2010-10-19 19:01     ` [Qemu-devel] " Paolo Bonzini
2010-10-19 19:12       ` Balbir Singh
2010-10-19 19:29         ` 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=4CB86853.9060408@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arun@linux.vnet.ibm.com \
    --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).