Answer by BeeOnRope for Genuinely test std::atomic is lock-free or not
I think you are really just trying to detect this special case specific to gcc where is_lock_free reports false, but the underlying implementation (hidden behind a libatomic function call) is still...
View ArticleAnswer by Peter Cordes for Genuinely test std::atomic is lock-free or not
Other than performance, the standard doesn't guarantee any way you can tell; that's more or less the point.If you are willing to introduce some platform-specific UB, you could do something like cast a...
View ArticleGenuinely test std::atomic is lock-free or not
Since std::atomic::is_lock_free() may not genuinely reflect the reality [ref], I'm considering writing a genuine runtime test instead. However, when I got down to it, I found that it's not a trivial...
View Article
More Pages to Explore .....