It is said an assembly instruction prefixed by "lock" is atomic. I want to know if "lock" can only affect one assembly instruction; Is an assembly instruction itself not atomic?
Here is an example of an atomic function in linux kernel:
static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
{ unsigned char c;
__asm__ __volatile__(
LOCK "subl %2,%0; sete %1"
:"=m" (v->counter), "=qm" (c)
:"ir" (i), "m" (v->counter) : "memory");
return c; }
In this example can subl and sete be interrupted?