Re: Atomic Operations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Markus Schiltknecht <markus(at)bluegap(dot)ch>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Atomic Operations
Date: 2007-01-10 19:36:39
Message-ID: 15333.1168457799@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Markus Schiltknecht <markus(at)bluegap(dot)ch> writes:
> what are the assumptions PostgreSQL normally does about atomic
> operations?

Rule of thumb: you want to touch shared memory, you use a lock.

There are a few places that violate it, but in general you'd better have
a pretty darn good reason to not use a lock.

Offhand I recall that we assume TransactionId can be stored atomically
in a couple of places where locking would be inconvenient. (This is one
of the good reasons for not wanting to widen TransactionId to 64 bits
... the assumption would then fail on some platforms.) I do not believe
we assume that pointers can be stored atomically.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2007-01-10 19:45:24 Re: Added the word TODO in comments
Previous Message Stefan Kaltenbrunner 2007-01-10 19:22:20 Re: ECPG regression test failures on Solaris 10/x86_64