[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set s

From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v5 07/18] qemu-thread: add simple test-and-set spinlock
Date: Tue, 17 May 2016 15:12:40 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 05/17/2016 01:01 PM, Sergey Fedorov wrote:
>> Sorry, I can't see reading ARMv6 ARM that 1-byte access can't be atomic. What
>> I've found:
>>     B2.4.1 Normal memory attribute
>>     (snip)
>>     Shared Normal memory
>>         (snip)
>>         ... Reads to Shared Normal Memory that are aligned in memory to the
>>         size of the access must be atomic.
> Looks like GCC has no trouble generating __atomic_store_n() for 1-byte bool...

Not loads and stores, but other atomic ops like xchg.  The native atomic
operations are all 4 bytes long.

I suppose the compiler may well be able to synthesize sub-word atomic ops, but
it'll be 2 or 3 times the size of a word-sized atomic op, and for no good 


reply via email to

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