Re: PATCH: pgbench - option to build using ppoll() for largerconnection counts - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: PATCH: pgbench - option to build using ppoll() for largerconnection counts
Date
Msg-id alpine.DEB.2.20.1801262348420.17596@lancre
Whole thread Raw
In response to Re: PATCH: pgbench - option to build using ppoll() for largerconnection counts  ("Rady, Doug" <radydoug@amazon.com>)
Responses Re: PATCH: pgbench - option to build using ppoll() for largerconnection counts
List pgsql-hackers
Hello Doug,

Patch applies, compiles, tests ok.

>    > [...] Replaced USE_PPOLL with HAVE_PPOLL as having both seems redundant.
>
>    I'm okay with that. I'm wondering whether there should be a way to force
>    using one or the other when both are available. Not sure.
>
> Added option to force use of select(2) via:  -DUSE_SELECT

USE_SELECT could mean something somewhere. Maybe use something more 
specific like PGBENCH_USE_SELECT? Having this macro available simplifies 
testing.

I'm not sure why you do the following trick, could you explain?
   +#undef USE_SELECT
   +#define USE_SELECT

In the select implementation you do:

  return (socket_set *) pg_malloc0(sizeof(socket_set) * MAXCLIENTS);

but ISTM that socket_set is already an fd_set which represents a set of 
clients, so allocating a number of it is needed. The initial 
implementation just does "fs_set input_mask", whetever the number of 
clients, and it works fine.

-- 
Fabien.


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Refactoring identifier checks to consistently use strcmp
Next
From: Andres Freund
Date:
Subject: Re: Setting BLCKSZ 4kB