Re: visibility maps - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: visibility maps
Date
Msg-id 493A8BD7.6060809@enterprisedb.com
Whole thread Raw
In response to visibility maps  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Responses Re: visibility maps  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Re: visibility maps  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-hackers
Pavan Deolasee wrote:
>     /*
>      * We don't need to lock the page, as we're only looking at a single
> bit.
>      */
>     result = (map[mapByte] & (1 << mapBit)) ? true : false;
> 
> 
> Isn't this a dangerous assumption to make ? I am not so sure that even a bit
> can be read atomically on all platforms. 

Umm, what non-atomic state could the bit be in? Half-set, half-cleared? 
Or do you think that if some other bit in proximity is changed, the 
other bit would temporarily flip 0->1->0, or something like that? I 
don't think that should happen.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: visibility map - what do i miss?
Next
From: Heikki Linnakangas
Date:
Subject: Re: visibility maps and heap_prune