[Mesa-dev] Atomics not really atomic?

Maarten Lankhorst maarten.lankhorst at canonical.com
Wed Jan 22 06:08:34 PST 2014


op 22-01-14 14:44, Lauri Kasanen schreef:
> Hi,
>
> The two atomic helpers in u_atomic.h, p_atomic_set and p_atomic_read,
> are just passthrough macros, without the atomic guarantees. Why?
>
> I believe I saw some corruption because of this, where a 64-bit
> write on a 32-bit platform may not be naturally atomic.
 From what I can tell p_atomic only supports 32-bits atomics. atomics don't imply barriers, so
the code is probably correct for 32-bits. There is no 64-bits support in that code,
so I don't see how that would have protected a 64-bits write..

~Maarten


More information about the mesa-dev mailing list