Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKtUh-000212-0m for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2023 04:04:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKtUf-0001LJ-Pg for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Jan 2023 04:04:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKtUf-0001KF-GG for pgsql-hackers@lists.postgresql.org; Thu, 26 Jan 2023 04:04:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKtUb-0004My-8q for pgsql-hackers@postgresql.org; Thu, 26 Jan 2023 04:04:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 30Q4402w2888103; Wed, 25 Jan 2023 23:04:00 -0500 From: Tom Lane To: Thomas Munro cc: Nathan Bossart , "Hayato Kuroda (Fujitsu)" , "pgsql-hackers@postgresql.org" Subject: Re: suppressing useless wakeups in logical/worker.c In-reply-to: References: <20221202195503.GD2277157@nathanxps13> <20221205173523.GA2714833@nathanxps13> <20230109174217.GA1112698@nathanxps13> <2557815.1674603908@sss.pgh.pa.us> <20230125235004.GA1327755@nathanxps13> <20230126003319.GA1507251@nathanxps13> <2878152.1674700077@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Thu, 26 Jan 2023 16:57:23 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2888101.1674705840.1@sss.pgh.pa.us> Date: Wed, 25 Jan 2023 23:04:00 -0500 Message-ID: <2888102.1674705840@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > On Thu, Jan 26, 2023 at 3:28 PM Tom Lane wrote: >> It'd probably be reasonable to file down that sharp edge by instead >> specifying that TimestampDifferenceMilliseconds will clamp overflowing >> differences to LONG_MAX. Maybe there should be a clamp on the underflow >> side too ... but should it be to LONG_MIN or to zero? > That got me curious... Why did WaitLatch() use long in the first > place? Good question. It's not a great choice, because of the inherent platform specificity. OTOH, I'm not sure it's worth the pain to change now. regards, tom lane