↧
Answer by Cyril Gao for Lock-free stack with reference counting
I think that the implementation has other problem:Let us suppose that two threads are working on a non-empty lock free stack:thread A calls push() to add a new node, after the line of code...
View ArticleAnswer by Ben Voigt for Lock-free stack with reference counting
It is possible, but not problematic, because the compare_exchange call will detect it and discard new_counter.
View ArticleLock-free stack with reference counting
From answers to my previous question:Pointers in c++ after deleteit's become clear, that using the values of pointers, that point to "deleted" memory (in particular, copying them) lead to undef...
View Article