Re: DSM segment handle generation in background workers

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Noah Misch <noah@leadboat.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-11-14T15:25:03Z
Lists: pgsql-hackers
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.

			regards, tom lane


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().