qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Race condition between signal handler and cpu_exec()


From: Jamie Lokier
Subject: Re: [Qemu-devel] Race condition between signal handler and cpu_exec()
Date: Fri, 6 Mar 2009 01:05:55 +0000
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]