Subject: Re: ingres and atomicity
To: None <tech-userlevel@NetBSD.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: tech-userlevel
Date: 06/16/2005 09:50:09
--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 15, 2005 at 06:59:52PM -0400, der Mouse wrote:
> >> However some architectures (eg sparc) [...don't support that...]
> > Doesn't the Load-Link / Store Conditional allow exactly that?
>=20
> I think you have the SPARC confused with some other architecture
> (PowerPC maybe? - I know I've seen those names but can't recall which
> architecture they go with).

PowerPC has (I don't know about POWER):

ldarwx	(load from address, word, and get reservation)
starwx.	(store to address, word, if we have reservation for that address)

if you fail, simply retry the sequence.

You are guaranteed to have at least one active reservation per CPU.

You need cached memory for this to work.

Adress granularity might be less than a single word (in reality, is=20
something like cache-line size, but you can't depend on this).

I think this is a hint about how it's implemented.

The PPC $FOO manual contains examples for implementing TAS, CAS,=20
linked list manipulation, etc, on top of those instructions.

Regards,
	-is
--=20
seal your e-mail: http://www.gnupg.org/

--W/nzBZO5zC0uMSeA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFCsS8uN4tiz3B8hB0RAhuxAJwM7kRL4exf/bfBZzQZXJRZ+lsOgQCfXuPY
ZJ16G8IhdpMyyIjPmOffMWE=
=hoqG
-----END PGP SIGNATURE-----

--W/nzBZO5zC0uMSeA--