Something went wrong while setting issue due date.
multiprocessing: implement atomic operations
Implement atomic operations:
atomic-incf
, atomic-decf
and compare-and-swap
(or conditional-store
as it's named in the CLX). We already depend on boehm-gc, which pulls libatomic_ops, so this shouldn't be a big problem.
(mp:atomic-incf place 3)
(mp:atomic-decf place 3)
(mp:compare-and-swap place old-value new-value)
It would be nice to have it in both multiprocessing and non-thread builds (on the latter these would be dull macros for incf
, decf
and
(when (eq ,place ,old-value)
(setf ,place ,new-value)
t)
if so, maybe it would be good to put them in ext? I think not, because without-interrupts is already in the mp package.