> Tested on my mac, it works.

thanks!

> Didn't look much in code detail here, but the nested stale-fd loop is
> O(nregistered * (num of EV_ERROR)) . Probably fine at  pgbench scale.

Yes, the cost is O(nregistered * nclosed), however this is the worst case where 
all clients
are closed (the test end or the server crash).

The only case I doubt is -C/--connect test. On the other hand
there is sync call of PQconnectdb(), and the kernel usually hands
back the same fd number, in which case EV_ADD just
re-attaches the knote silently, without EV_ERROR.

Ofc this can be fixed with some algo based on sort+merge, but for now I prefer
to keep simple solution; that can be changed later. 

In longer term, it might be worth redesigning the way fds are added
and deleted in threadRun loop, in the same spirit as the O(n)-per-wakeup issues
Yura mentioned above.

--
Best regards,
Roman Khapov

Reply via email to