MacroPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

update-atomic

Arguments: (var place) form

This macro expands into code that does a read-modify-write operation that is atomic with respect to the value in place. That is, the value in place is read and bound to a local variable; the value of a form is computed; then the result is stored back in place as long as that value hasn't changed since the update-atomic code read and saved it. If it has changed (tested using eq), then the new value is acquired and bound to the local variable, the form value is recomputed, and another conditional store attempt is made. This loop continues until the store is successful.

The arguments are:

Note on the place argument: 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.

update-atomic could be used to implement (incf-atomic (car x)) like this:

(update-atomic (v (car x)) (1+ v))

See smp.htm and multiprocessing.htm for more information on this macro and on multiprocessing.


Copyright (c) 1998-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 9.0. This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version