Hi Pádraig,
> Wow that's much better on a 40 core system:
>
> Before your patch:
> =
> $ time ./test-lock
> Starting test_lock ... OK
> Starting test_rwlock ... OK
> Starting test_recursive_lock ... OK
> Starting test_once ... OK
>
> real1m32.547s
> user1m32.455s
> sys
On 24/12/16 17:52, Bruno Haible wrote:
> Hi Pádraig,
>
>> Wow that's much better on a 40 core system:
>>
>> Before your patch:
>> =
>> $ time ./test-lock
>> Starting test_lock ... OK
>> Starting test_rwlock ... OK
>> Starting test_recursive_lock ... OK
>> Starting test_once ... OK
> > What happens when a program reads from a 'volatile' variable
> > at address xy in a multi-processor system?
Looking at the assembler code produced by GCC: GCC does not emit
any barrier or similar instructions for reads or writes to 'volatile'
variables. So, the loop in test_lock actually waits