Re: PATCH: pgbench - option to build using ppoll() for larger connection counts

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Andres Freund <andres@anarazel.de>
Cc: "Rady, Doug" <radydoug@amazon.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>
Date: 2018-03-01T10:30:39Z
Lists: pgsql-hackers
>> -#ifdef HAVE_SYS_SELECT_H
>> +#ifdef PGBENCH_USE_SELECT			/* force use of select(2)? */
>> +#undef HAVE_PPOLL
>> +#endif
>> +#ifdef HAVE_PPOLL
>> +#include <poll.h>
>> +#elif defined(HAVE_SYS_SELECT_H)
>> +#define POLL_USING_SELECT
>
> (random thing noticed while going through patches)
>
> It strikes me as a bad idea to undefine configure selected
> symbols. Postgres header might rely on them. It also strikes me as
> entirely unnecessary here.

Yes, I though about this one but let it pass. Indeed, it would be 
sufficient to not load "poll.h" when select is forced, without undefining 
the configure setting.

-- 
Fabien.


Commits

  1. Use ppoll(2), if available, to wait for input in pgbench.

  2. Use pselect(2) not select(2), if available, to wait in postmaster's loop.