Re: bitops atomicity question

Pavel Machek (pavel@Elf.mj.gts.cz)
Mon, 25 Aug 1997 16:56:54 +0200


> 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.

Hmm, I was talking about asm/bitops.h - and lock prefix _is_ there for
SMP. But then one thing is unclear for me:

If these are not expected to be atomic by generic code, then lock is
unnecessary, and just slows system down.

If these are expected to be atomic then generic code will fail on
sparc32 /SMP.

Or am I wrong?
Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).