Re: Musing about arcane (?) topics...
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]> Sat, 20 Jun 2026 18:39:28 -0700
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Turns out to have been a bigger topic than I imagined. TLDR; DWCAS is problematic to an extreme, and a severe performance drag. I can also guarantee the complete absense of ABA issues with Single-Wide CAS, but adopting indirection and ensuring that all mutation occurs only in those envelope wrappers. The body of the data structures need to be treated as immutable. You can make a fresh copy and safely mutate the envelope pointer under CAS, while holding a pointer to the old version. Since you hold the old copy, it cannot have been released to the GC and then used to construct a fresh copy. Hence, impossible to ABA with mutated A. - DM > On Jun 20, 2026, at 05:20, David McClain <[email protected]> wrote: > > Maybe not so arcane… > > The ARM architecture supports DCAS - double-wide CAS (compare and swap). This would be useful to help avoid the ABA problem that might occur, fooling a single-wide CAS into thinging that the internal state had not changed. > > By using a 2nd word for tag info - incrementing with every state change, we can avoid this blindness on the part of CAS. > > So… anyone have an implementation of ARM DCAS for LW? > > - DM _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html