Correction to comment regarding atomicity of an operation

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: PGSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Correction to comment regarding atomicity of an operation
Date: 2012-09-12 00:02:36
Message-ID: CABwTF4Ubk9wc+JP0PhjPSUuty30h=k=2apii6_-1TQgdFCbghw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This comment in UpdateFullPageWrites() seems to be inaccurate:

* It's safe to check the shared full_page_writes without the lock,
* because we assume that there is no concurrently running process which
* can update it.

That assumption does not hold on any sane SMP system.

I think the real reason is that we assume that read/write to an integer is
atomic, like we do for TransactionId variables:

heapam.c: "TransactionId read/write is assumed atomic anyway."

Best regards,

PS: As usual, I hope I am not missing something very obvious.
--
Gurjeet Singh

http://gurjeet.singh.im/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-09-12 00:52:45 Re: Doc typo: lexems -> lexemes
Previous Message Tom Lane 2012-09-11 23:39:29 Re: Cast Operator Precedence