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 1jg55G-0004xj-UP for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2020 11:27:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jg55F-0002RA-OW for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2020 11:27:53 +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 1jg55F-0002R3-IN for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2020 11:27:53 +0000 Received: from courriel-2.mines-paristech.fr ([77.158.173.19] helo=antispam-1.ensmp.fr) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jg55D-0003O8-Ct for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2020 11:27:53 +0000 Received: from smtp-4.mines-paristech.fr (smtp-4.ensmp.fr [77.158.173.143]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by antispam-1.ensmp.fr (antispam.mines-paristech.fr) with ESMTPS id 7E7335639B; Tue, 2 Jun 2020 13:27:49 +0200 (CEST) Received: from pseudopolis-wln.cri.ensmp.fr (adsl.cri.pck.nerim.net [213.41.146.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-4.mines-paristech.fr (Postfix) with ESMTPSA id 235842C0049; Tue, 2 Jun 2020 13:27:49 +0200 (CEST) Date: Tue, 2 Jun 2020 13:27:48 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@pseudo To: David Rowley cc: Tom Lane , "Jawarilal, Manish" , "pgsql-bugs@lists.postgresql.org" Subject: Re: pgbench bug / limitation In-Reply-To: Message-ID: References: <7221.1590687090@sss.pgh.pa.us> <10327.1590763515@sss.pgh.pa.us> <384920.1591027137@sss.pgh.pa.us> <512846.1591057287@sss.pgh.pa.us> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2056645051-1159473274-1591097269=:87735" X-CLAMAV-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedrudefjedgvdejucetufdoteggodetrfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvufgjkfhffgggtgesmhdtreertdervdenucfhrhhomhephfgrsghivghnucevqffgnffjqfcuoegtohgvlhhhohestghrihdrvghnshhmphdrfhhrqeenucggtffrrghtthgvrhhnpeehkeduhedtjeehleehtefhjeefgedvgfeltdegtedttdehtdegvedugfefleelvdenucfkphepvddufedrgedurddugeeirddvvdefnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2056645051-1159473274-1591097269=:87735 Content-Type: text/plain; charset=US-ASCII; format=flowed Attached is a blind attempt at working around the issue based on what you show below, that I cannot test. > typedef struct fd_set { > u_int fd_count; /* how many are SET? */ > SOCKET fd_array[FD_SETSIZE]; /* an array of SOCKETs */ > } fd_set; > > #define FD_SET(fd, set) do { \ > u_int __i; \ > for (__i = 0; __i < ((fd_set FAR *)(set))->fd_count; __i++) { \ > if (((fd_set FAR *)(set))->fd_array[__i] == (fd)) { \ > break; \ > } \ > } \ > if (__i == ((fd_set FAR *)(set))->fd_count) { \ > if (((fd_set FAR *)(set))->fd_count < FD_SETSIZE) { \ > ((fd_set FAR *)(set))->fd_array[__i] = (fd); \ > ((fd_set FAR *)(set))->fd_count++; \ > } \ > } \ > } while(0, 0) -- Fabien. --2056645051-1159473274-1591097269=:87735 Content-Type: text/x-diff; name=pgbench-select-win-1.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-select-win-1.patch ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jDQppbmRleCAwOGE1OTQ3YTllLi4wYzk2 Mzg0ZWNiIDEwMDY0NA0KLS0tIGEvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2gu Yw0KKysrIGIvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KQEAgLTY2OTgs MTAgKzY2OTgsMjIgQEAgY2xlYXJfc29ja2V0X3NldChzb2NrZXRfc2V0ICpz YSkNCiAJc2EtPm1heGZkID0gLTE7DQogfQ0KIA0KKyNpZm5kZWYgV0lOMzIN CisjZGVmaW5lIEJBRF9GRF9TRVRTSVpFKGZkLCBzZXQpICgoZmQpIDwgMCB8 fCAoZmQpID49IEZEX1NFVFNJWkUpDQorI2Vsc2UNCisvKg0KKyAqIFdpbmRv d3MgaW1wbGVtZW50YXRpb24gaXMgYm9ndXM6IGl0IGRvZXMgbm90IGFsbG9j YXRlZCBmZCB3aXRoIHRoZSBsb3dlc3QNCisgKiBwb3NzaWJsZSBudW1iZXIs IGFuZCBGRF9TRVQgaXMgaW1wbGVtZW50ZWQgYXMgYSBzaW1wbGUgYXJyYXku DQorICoNCisgKiBGaWxsaW5nIHRoZSBzZXQgaXMgaW4gTyhOXjIpLg0KKyAq Lw0KKyNkZWZpbmUgQkFEX0ZEX1NFVFNJWkUoZmQsIHNldCkgKChzZXQpLT5m ZF9jb3VudCA+PSBGRF9TRVRTS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