Skip to contentSkip to conversation

Question about Atomic operations

DISCUSSION Devesh Sharma 1 participant 1 message Aug 31, 2006

lore
Share & tools
lore
#0 lore raw

Hello Arjan and list,

The documentation related to atomic operations says that the following functions should be called in SMP safe maner

void atomic_add(int i, atomic_t *v);
void atomic_sub(int i, atomic_t *v);
void atomic_inc(atomic_t *v);
void atomic_dec(atomic_t *v);

since the implementation of these functions are prefixed with LOCK prefix (On i386 arch.) which either asserts LOCK# signal or performs cache locking which gauarentees coherency.

Then why these functions should be called in SMP safe manner?