Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 116 by
chatelet...@gmail.com: False positive with asm release
semantic and atomic_compare_and_exchange
http://code.google.com/p/data-race-test/issues/detail?id=116
Full story described here
https://github.com/OpenImageIO/oiio/issues/720.
Short story :
https://github.com/OpenImageIO/oiio/blob/master/src/include/thread.h l.542
implements a spin lock.
TSan reports data race with one write l.568
> // Fastest way to do it is with a store with "release" semantics
> __asm__ __volatile__("": : :"memory");
> m_locked = 0; <<<< this line
and a compare and exchange l.597
> return atomic_compare_and_exchange (&m_locked, 0, 1);
m_locked is of type `volatile int`.
There is already a debate in the above mentioned thread about the
usefulness of volatile. I'm not a low level concurrency expert so I
actually don't know if the asm code has the correct semantic or not.
Environment:
- clang version 3.3 (tags/RELEASE_33/final)
- Arch Linux x86_64, kernel 3.11.6-1-ARCH
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings