Unsolved pointer is often invalid when dealing with atomic operations
-
i'm looking at this article: https://woboq.com/blog/introduction-to-lockfree-programming.html
and here's the code presented there: https://hastebin.com/xazimuyequ.cppwhen i run it, it works 1/10 times, 9/10 times it crashes on line 60:
while (!m_head.testAndSetOrdered(n, n->next));
the exception is a read access violation for
n->next
. why does it behave like this? -
Hi
Tried the code but no matter how many times i press the buttons, it does not crash.
-
i wrote this in console application but that shouldn't be a problem, no?
i tried with both visual studio and qt creator, both behave the same. qt creator crashes less often, though. -
Hi,
Can you share the version of everything you are currently using ?
-
@SGaist
visual studio 2017 / qt creator 4.6.1
qt 5.11.0
windows 10