Re: Musing about arcane (?) topics...

Martin Simmons <[email protected]> Wed, 24 Jun 2026 18:52:08 +0100
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Are you only considering ABA problems that involve allocation?  The lock-free
stack example in https://en.wikipedia.org/wiki/ABA_problem could happen in
Lisp.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



>>>>> On Wed, 24 Jun 2026 03:46:38 -0700, David McClain (as dbm at refined-audiometrics dot com) said:
> 
> Even more fundamental result: 
> 
> ABA problems *cannot* happen in Common Lisp proper (excluding FLI), nor in any other “Memory Safe” system. 
> 
> Storage for A (the old value) being held for use in a CAS operation, cannot be discarded by the GC and reused by an MRU allocator to produce a C object with Addr(C) = Addr(A).
> 
> An ABA problem arises when ABA could become ABC, with Addr(C) = Addr(A), just prior to the CAS operation. The CAS will succeed and produce ABX, where X = the locking value, thereby discarding C, and hence producing an “ABA Problem”. When ABX later gets updated to ABA′. The A′ will have been produced using stale information, A, and history, in C, will have been discarded.
> 
> There is no need to mandate immutability of data to avoid ABA problems in Lisp. They simply cannot ever happen.
> 
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> [email protected]
> http://www.lispworks.com/support/lisp-hug.html
> 

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html