Subject: Re: lock-free data structures
To: Chapman Flack <nblists@anastigmatix.net>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 01/02/2006 18:03:11
Chapman Flack wrote:

> Ignatios Souvatzis wrote:
>
>>> An immediate drawback is that not all architectures support the cmpxchg
>>> instruction.
>>
>
> Out of curiosity, anybody have an idea what fraction of NetBSD
> supported MP architectures (maybe weighted by prominence?) have a
> cmpxchg instruction (or a loadlinked/storeconditional, lwarx/stwcx
> or other feature that can be used to the purpose)?

Isn't this the "normal" way of handling locking on SMP class machines? 
(Actually, I'd sort of guess that even a lot of non-SMP architectures
have this kind of instruction e.g. for synchronizing interrupts, etc.)

So I guess it may be more interesting to hear about any counter
examples, where this kind of instruction cannot be used, especially on
SMP class machines.  (On uniprocessor systems its easy to see how to
simulate this with a biglock.)

    -- Garrett

>
> I notice that the JACK Audio Connection Kit (which it might be nice
> to be able to port) likes to do userspace lock-free stuff with shared
> memory.
>
> -Chap



-- 
Garrett D'Amore                          http://www.tadpolecomputer.com/
Sr. Staff Engineer          Extending the Power of 64-bit UNIX Computing
Tadpole Computer, Inc.                             Phone: (951) 325-2134