Pavan Deolasee wrote:
On Sat, Dec 6, 2008 at 7:57 PM, Heikki Linnakangas <
[EMAIL PROTECTED]> wrote:
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.
Since the lock is not held, the bit can be flipped while we are reading,
isn't it ? IOW, the test is not reliable is what I fear.
If someone is changing the bit at the same time, it doesn't matter
whether we read it as 1 or 0. Locking the page wouldn't change the
situation: you would still read the old value if you got the lock before
the concurrent updater, or the new value if you got the lock after.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers