| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |
Arguments: place newval-form oldval-form
This is the primitive form on which some other atomic operations (update-atomic, incf-atomic, decf-atomic, pop-atomic, and push-atomic) are based. It acts very much like
(when (eq place oldval-form) (setf place newval-form) t)
In atomic-conditional-setf, the computation of place subforms, oldvalform, and newval-form are not atomic with respect to anything but the comparison and store (if there is one) are an atomic sequence.
A technical compiler issue limits it to appearing only as the test
form in a conditional, as in the following example of an atomic
increment equivalent to (incf-atomic (car x))
:
(loop (let* ((old (car x)) (new (1+ old))) (when (atomic-conditional-setf (car x) new old) (return))))
Not all places legal as the first argument of setf can be used as the place argument to this macro. The list of allowable places can be found in Atomic read-modify-write primitives in smp.htm.
See smp.htm and multiprocessing.htm for more information on this macro and on multiprocessing.
Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version |