Re: DSM segment handle generation in background workers

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Noah Misch <noah@leadboat.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-11-15T03:28:43Z
Lists: pgsql-hackers
On Thu, Nov 15, 2018 at 4:25 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
> > What do you think about the attached?
>
> I think you need to cast MyStartTimestamp to uint64 before shifting
> to ensure portable behavior of the shifts.  In principle it wouldn't
> matter because the int64 sign bit is nowhere near the part we care
> about, but I've heard some pretty wild claims about what compiler
> writers are entitled to do with "undefined" cases.

Thanks.  Pushed.

-- 
Thomas Munro
http://www.enterprisedb.com


Commits

  1. Increase the number of possible random seeds per time period.

  2. Refactor pid, random seed and start time initialization.

  3. Increase the number of different values used when seeding random().