Re: [COMMITTERS] pgsql: Do all accesses to shared buffer

From: Neil Conway <neilc(at)samurai(dot)com>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [COMMITTERS] pgsql: Do all accesses to shared buffer
Date: 2005-10-21 21:43:49
Message-ID: 1129931029.19971.11.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message James William Pye 2005-10-21 21:55:15 python - be: Implement the new type system.
Previous Message Tom Lane 2005-10-21 21:43:46 pgsql: Improve performance of CHECK_FOR_INTERRUPTS() macro on Windows by

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-10-21 21:46:47 Re: [PATCHES] Win32 CHECK_FOR_INTERRUPTS() performance tweak
Previous Message Tom Lane 2005-10-21 21:17:53 Re: Seeing context switch storm with 10/13 snapshot of