Re: [COMMITTERS] pgsql: Do all accesses to shared buffer - Mailing list pgsql-hackers

From Neil Conway
Subject Re: [COMMITTERS] pgsql: Do all accesses to shared buffer
Date
Msg-id 1129931029.19971.11.camel@localhost.localdomain
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Do all accesses to shared buffer headers through  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: [COMMITTERS] pgsql: Do all accesses to shared buffer
List pgsql-hackers
On Mon, 2005-17-10 at 16:48 -0500, Jim C. Nasby wrote:
> Sorry if I'm just confused here, but don't LWLocks protect data
> structures susceptible to corruption? And if that's the case don't we
> need to be sure that the compiler can't optimize around them?

LWLocks certainly do protect shared data, and if the compiler rearranged
loads and stores around LWLocks acquire/release, it would result in
corruption. Tom was arguing it is unlikely the compiler will actually do
this (because LWLockAcquire is an out-of-line function call that might
invoke a system call, unlike SpinLockAcquire).

-Neil




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Seeing context switch storm with 10/13 snapshot of
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance tweak