I'm debugging some code here where I get problems related to
spinlocks, anyhow, while running through the files I noticed
that the UNLOCK code seems sort of broken.

What I mean is that on machines that have loosely ordered
memory models you can have problems because of data that's
supposed to be protected by the lock not getting flushed
out to main memory until possibly after the unlock happens.

I'm pretty sure you guys need memory barrier ops.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

Tue, 5 Dec 2000 06:48:13 -0800
Alfred Perlstein <bright@wintelcom.net>
Spinlocks may be broken.
Alfred Perlstein <bright@wintelcom.net> writes:
> I'm pretty sure you guys need memory barrier ops.

On a machine that requires such a thing, the assembly code for UNLOCK
should include it.  Want to provide a patch?

			regards, tom lane

Tue, 05 Dec 2000 10:24:07 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: Spinlocks may be broken. 
* Tom Lane <tgl@sss.pgh.pa.us> [001205 07:24] wrote:
> Alfred Perlstein <bright@wintelcom.net> writes:
> > I'm pretty sure you guys need memory barrier ops.
> 
> On a machine that requires such a thing, the assembly code for UNLOCK
> should include it.  Want to provide a patch?

My assembler is extremely rusty, you can probably find such code
in the NetBSD or Linux kernel for all the archs you want to do.
I wouldn't feel confident providing a patch, all I have is x86
hardware.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

Tue, 5 Dec 2000 07:26:32 -0800
Alfred Perlstein <bright@wintelcom.net>
Re: Spinlocks may be broken.