Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aJlch-0007jG-Uv for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jan 2016 17:23:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aJlch-0004Xw-HQ for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Jan 2016 17:23:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aJlbL-0001P0-QP for pgsql-hackers@postgresql.org; Thu, 14 Jan 2016 17:22:23 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aJlbJ-00086a-7d for pgsql-hackers@postgresql.org; Thu, 14 Jan 2016 17:22:22 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 1E93C860003; Thu, 14 Jan 2016 18:22:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p54BEB543.dip0.t-ipconnect.de [84.190.181.67]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 54E11860002; Thu, 14 Jan 2016 18:22:17 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id D8528102B26; Thu, 14 Jan 2016 18:22:16 +0100 (CET) Date: Thu, 14 Jan 2016 18:22:16 +0100 From: Andres Freund To: Robert Haas Cc: Tom Lane , =?utf-8?B?0JLQsNGB0LjQu9GM0LXQsiDQlNC80LjRgtGA0LjQuQ==?= , "pgsql-hackers@postgresql.org" Subject: Re: Performance degradation in commit ac1d794 Message-ID: <20160114172216.GL10941@awork2.anarazel.de> References: <20151225211326.z4umuafvv27nczya@alap3.anarazel.de> <24833.1451078993@sss.pgh.pa.us> <20151226112248.uv3qxmroe4va7wke@alap3.anarazel.de> <20160114143931.GG10941@awork2.anarazel.de> <20160114155617.GI10941@awork2.anarazel.de> <20160114170604.GJ10941@awork2.anarazel.de> <20160114171421.GK10941@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160114171421.GK10941@awork2.anarazel.de> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2016-01-14 18:14:21 +0100, Andres Freund wrote: > I'm thinking of something like; > > int WaitOnLatchSet(LatchEventSet *set, int wakeEvents, long timeout); > > int > WaitLatchOrSocket(volatile Latch *latch, int wakeEvents, pgsocket sock,long timeout) > { > LatchEventSet set; > > LatchEventSetInit(&set, latch); > > if (sock != PGINVALID_SOCKET) > LatchEventSetAddSock(&set, sock); > > return WaitOnLatchSet(set, wakeEvents, timeout); > } > > I think we'll need to continue having wakeEvents and timeout parameters > for WaitOnLatchSet, we quite frequently want to wait socket > readability/writability, not wait on the socket, or have/not have > timeouts. This brings me to something related: I'm wondering if we shouldn't merge unix/win32_latch.c. If we go this route it seems like the amount of shared infrastructure will further increase. The difference between win32 and, say, the select code isn't much bigger than the difference between select/poll. epoll/win32 are probably more similar than that actually. Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers