[cfe-dev] Can thread safety tools works with std::memory_order?

Yafei Liu via cfe-dev cfe-dev at lists.llvm.org
Wed Dec 16 00:45:49 PST 2020


I'm curious if tools like thread sanitizer and thread analyzer can detect
invalid accesses due to using std::memory_order?

Why I'm asking is that, to me, std::memory_order bugs is not the same with
normal synchronization bugs, normal synchronization bugs are due to write
the wrong code (to access a critical region out of a lock guard for
example), but memory_order bugs are due to generate wrong optimized code
(still invalid access, but isn't write by programmer directly).

So can tools like thread sanitizer and thread analyzer can handle this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20201216/cab0b554/attachment.html>


More information about the cfe-dev mailing list