Re: visibility maps

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: visibility maps
Date: 2008-12-11 13:33:32
Message-ID: 494116AC.8050701@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavan Deolasee napsal(a):
> On Thu, Dec 11, 2008 at 5:01 PM, Zdenek Kotala <Zdenek(dot)Kotala(at)sun(dot)com> wrote:
>> IIRC, Memory reading/writing is atomic operation. Only one CPU(hw thread)
>> can access to the same memory address(es)* in same time*. The question is
>> how compiler compile C code to assembler. But this code seems to me safe.
>
> Yeah, I think the code is safe because we are just reading a bit.
>
> BTW, I wonder if we need to acquire EXCLUSIVE lock while writing the
> visibility map bit ?

Yes, because it is not simple write operation. You need to read byte from memory
to register, set bit and write it back. Write memory itself is atomic but
somebody could change other bits between read and write.

Zdenek

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2008-12-11 13:41:16 Re: visibility maps
Previous Message Tom Lane 2008-12-11 13:28:08 Re: Refactoring SearchSysCache + HeapTupleIsValid