From: Paolo Bonzini <pbonzini@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, Fabien Chouteau <chouteau@adacore.com>
Subject: Re: [Qemu-devel] Multiple instances of Qemu on Windows multicore
Date: Thu, 03 Nov 2011 12:50:14 +0100 [thread overview]
Message-ID: <4EB27FF6.2040907@redhat.com> (raw)
In-Reply-To: <4EB26CF4.7080806@redhat.com>
On 11/03/2011 11:29 AM, Avi Kivity wrote:
> > It would ensure that two mutators wouldn't run concurrently. In some
> > sense, signal-safe code could then be considered thread-safe too.
>
> How so? The scheduler can switch between the two threads on every
> instruction.
In general signal-safe is more stringent than thread-safe, but with two
exceptions: memory barriers and locked memory access. On x86 (implied
by Windows...) you might also assume that the compiler will generate
arithmetic operations with a memory destination, which makes code like
void cpu_interrupt(CPUState *env, int mask)
{
env->interrupt_request |= mask; /* <--- this */
cpu_unlink_tb(env);
}
signal-safe in practice---and even "thread-safe" on non-SMP systems.
It's a huge assumption though, and I don't think it should be assumed
anymore. With iothread the architecture of the QEMU main loop is anyway
completely different.
Paolo
next prev parent reply other threads:[~2011-11-03 11:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-02 15:38 [Qemu-devel] Multiple instances of Qemu on Windows multicore Fabien Chouteau
2011-11-02 16:25 ` Paolo Bonzini
2011-11-02 17:10 ` Fabien Chouteau
2011-11-02 17:16 ` malc
2011-11-02 17:45 ` Paolo Bonzini
2011-11-02 17:55 ` malc
2011-11-02 18:01 ` Peter Maydell
2011-11-02 19:52 ` Paolo Bonzini
2011-11-02 19:57 ` Peter Maydell
2011-11-03 9:56 ` Fabien Chouteau
2011-11-03 9:54 ` Fabien Chouteau
2011-11-03 10:10 ` Paolo Bonzini
2011-11-03 10:29 ` Avi Kivity
2011-11-03 11:50 ` Paolo Bonzini [this message]
2011-11-04 9:27 ` Fabien Chouteau
2011-11-04 9:34 ` 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=4EB27FF6.2040907@redhat.com \
--to=pbonzini@redhat.com \
--cc=avi@redhat.com \
--cc=chouteau@adacore.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).