[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set s
From: |
Sergey Fedorov |
Subject: |
Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock |
Date: |
Sat, 9 Apr 2016 00:35:42 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 09/04/16 00:31, Richard Henderson wrote:
> On 04/08/2016 02:26 PM, Paolo Bonzini wrote:
>>
>> On 08/04/2016 23:24, Alex Bennée wrote:
>>>> Except that quite a lot of hosts can only (efficiently) do atomic
>>>> operations on
>>>> a minimum of 4 byte quantities. I'd rather continue to use int here.
>>> I suspect bool == unsigned int underneath. But having true/false and 0/1
>>> mixed up
>>> gets confusing even if they are equivalent.
>> Sometimes sizeof(bool) == 1.
> sizeof(bool) == 1 everywhere except MacOSX, where it's 4.
>
Hm, that's too strange:
$ gcc a.c
a.c: In function ‘main’:
a.c:6:5: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘long unsigned int’ [-Wformat=]
printf("%d\n", sizeof(bool));
^
$ ./a.out
1
Kind regards,
Sergey
- [Qemu-devel] [PATCH v2 09/13] exec: add tb_hash_func5, derived from xxhash, (continued)
Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock, Richard Henderson, 2016/04/08
[Qemu-devel] [PATCH v2 10/13] tb hash: hash phys_pc, pc, and flags with xxhash, Emilio G. Cota, 2016/04/07
[Qemu-devel] [PATCH v2 02/13] compiler.h: add QEMU_ALIGNED() to enforce struct alignment, Emilio G. Cota, 2016/04/07
[Qemu-devel] [PATCH v2 08/13] qemu-thread: optimize spin_lock for uncontended locks, Emilio G. Cota, 2016/04/07
[Qemu-devel] [PATCH v2 07/13] qemu-thread: call cpu_relax() while spinning, Emilio G. Cota, 2016/04/07
[Qemu-devel] [PATCH v2 03/13] seqlock: remove optional mutex, Emilio G. Cota, 2016/04/07