Hi! Thanks for the review!

> Another solution to this is to have code which does not use fd_set but 
> instead uses its own method of building and using bit arrays. I have done 
> this in my professional development.
> I'll include the NOTES from Freebsd on the select(2) man page....
> 

I rechecked the docs and the kernel impl example [0].
There is some thought about I thinking:
- max absolute fd number will be limited by FD_SETSIZE, which is
  defined at compile time, would it be a fragile solution for runtime anyway?
  The the implementation of bit string must rely on architecture-depended things
  (ex: _DARWIN_UNLIMITED_SELECT), which will lead to a patch
  similar in size to the proposed?
- the cost of operations will have O(max_fd) instead of O(nfd),
  which is not critical for current implementation of pgbench, but in future may
  lead to refactor of struct socket_set or the code below
- kevent already used in backend code base for cases of several fds,
  proposed patch would be just continuation of [1] which have same style
  to waiteventset.c

[0] - 
https://elixir.bootlin.com/freebsd/v15.1/source/sys/kern/sys_generic.c#L1189
[1] - 
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=60e612b602999e670f2d57a01e52799eaa903ca9

--
Best regards,
Roman Khapov

Reply via email to