From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Race condition between signal handler and cpu_exec()
Date: Fri, 6 Mar 2009 01:05:55 +0000 [thread overview]
Message-ID: <20090306010555.GC13735@shareable.org> (raw)
In-Reply-To: <20090305221412.GI17410@hall.aurel32.net>
Aurelien Jarno wrote:
> I am currently too tired to find a proper solution (which should only
> use read/write to a variable to keep the operations atomic), I'll look
> at that tomorrow, but patches are welcome in the meanwhile.
The theoretically right thing in C is read/write a "volatile
sig_atomic_t". The GNU/Linux libc manual has a section "Atomic Data
Access and Signal Handling", where it says you can assume read/writing
an "int" and a pointer are also atomic in this respect on all machines
which matter.
Note that writing to a "char" is not atomic on old Alphas.
-- Jamie
next prev parent reply other threads:[~2009-03-06 1:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-05 22:14 [Qemu-devel] Race condition between signal handler and cpu_exec() Aurelien Jarno
2009-03-06 1:05 ` Jamie Lokier [this message]
2009-03-06 11:49 ` Julian Seward
2009-03-06 12:30 ` malc
2009-03-06 13:02 ` Jamie Lokier
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=20090306010555.GC13735@shareable.org \
--to=jamie@shareable.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.