I didn't see what you're talking about in the 15 year old message board discussion and I think if there was something specific and clear you would have copied and pasted it.
I also think that if you had any understanding of what you're saying, you would have given an explanation yourself.
So go ahead and actually put something here that you can back up. It is a common scenario where someone has no real evidence to link something adjacent and then tell someone to 'go find it in this link'.
int lfstack_pop(_Atomic lfstack_t \*lfstack)
{
lfstack_t next;
lfstack_t orig = atomic_load(lfstack);
do
{
if (orig.head == NULL) // undefined behavior !!!
{
return -1;
}
next.head = orig.head->next;
} while (!atomic_compare_exchange_weak(lfstack,&orig,next));
free(orig.head);
return 0;
}
If the first thread is preempted before the if(...) is executed, and then the second thread executes the entire method, then you will use data after freeing when the first thread resumes. Consider why the boost container doesn't free memory.Can you focus and nail down one claim with specifics before moving on to something else?
I've already done all the things you claim are impossible. That's how I know what you're saying is nonsense. Avoiding a double free on a pointer can always be done with atomic reference counting so that only one thread claims ownership. That's the whole story. You haven't given a shred of evidence to explain what garbage collection enables something that was previously impossible.
It is obvious that if you had something you could say that directly applies to what you claimed before (some algorithms can't be done without garbage collection), that you would have already said it a long time ago.