Re: vacuum as flags in PGPROC - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: vacuum as flags in PGPROC
Date
Msg-id 20071024141310.GF6559@alvh.no-ip.org
Whole thread Raw
In response to Re: vacuum as flags in PGPROC  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: vacuum as flags in PGPROC  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > In the spirit of incremental improvement, here is a patch that turns the
> > couple of bools in PGPROC into a bitmask, and associated fallout.
>
> Maybe declare the field as uint8 instead of char?  Otherwise, +1.

I'm wondering if it's safe to do something like

MyProc->vacuumFlags |= PROC_FOR_XID_WRAPAROUND

without holding the ProcArrayLock.  It seems in practice a type smaller
than "int" (which uint8 always is) is always stored atomically so this
shouldn't be a problem.

--
Alvaro Herrera                               http://www.PlanetPostgreSQL.org/
"La rebeldía es la virtud original del hombre" (Arthur Schopenhauer)

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: vacuum as flags in PGPROC
Next
From: Tom Lane
Date:
Subject: Re: vacuum as flags in PGPROC