All Manuals > LispWorks User Guide and Reference Manual > 15 Multiprocessing > 15.2 The process programming interface > 15.2.6 Old interrupt blocking APIs removed

NextPrevUpTopContentsIndex

15.2.6.4 Atomic plist update

Old:

(without-interrupts
 (setf (getf *global-plist* key) value))
     (without-interrupts
      (getf *global-plist* key))

New: use a lock, because a plist consists of more than one object so cannot be updated with low level atomic operations.

(defvar *global-plist-lock* (mp:make-lock :name "Global Plist"))
 
(mp:with-lock (*global-plist-lock*)
	      (setf (getf *global-plist* key) value))
 
(mp:with-lock (*global-plist-lock*)
	      (getf *global-plist* key))

LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex