[Mesa-dev] [PATCH v2] util/slab: re-design to allow migration between pools (v2)

Marek Olšák maraeo at gmail.com
Fri Sep 30 13:47:25 UTC 2016


On Fri, Sep 30, 2016 at 3:08 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> On Fri, Sep 30, 2016 at 2:13 PM, Marek Olšák <maraeo at gmail.com> wrote:
>> intptr_t reads and writes aren't atomic. p_atomic_set and
>> p_atomic_read functions don't do anything for atomicity. See:
>>
>> #define p_atomic_set(_v, _i) (*(_v) = (_i))
>> #define p_atomic_read(_v) (*(_v))
>
> That implementation seems bogus to me, as the compiler sees none of
> them as atomic and therefore the compiler can do strange stuff.
>
> why are intptr_t reads/writes less atomic than int32_t? IIRC on x86_64
> aligned 64-bit accesses are atomic, and on x86 intptr_t is just 32
> bits.

Really? Thanks, I didn't know that.

Marek


More information about the mesa-dev mailing list