Re: bitops atomicity question

David S. Miller (davem@jenolan.rutgers.edu)
Mon, 25 Aug 1997 03:33:09 -0400


Date: Sun, 24 Aug 1997 23:55:21 +0200
From: Pavel Machek <pavel@Elf.mj.gts.cz>

I just would like to ask:

Is test_and_clear_bit guaranteed to be atomic on SMP machines? (I
would like to create my own locking from userland - ipc semaphores
are way too slow - and need some atomic operations...)

Depends upon the platform:

Intel: If 'lock' prefix is there, yes.
Alpha: yes
Sparc32: no
Sparc64: yes
PPC: yes (??? Cort, correct me if I'm wrong)
m68k: N/A yet 8-)

Later,
David "Sparc" Miller
davem@caip.rutgers.edu