> On 12 Sep 2022, at 18:18, Julien Rouhaud <rjuju...@gmail.com> wrote:
> 
> That being
> said I don't know if adding a timeout would be too expensive for the lwlock
> infrastructure.

Implementation itself is straightforward, but we need to add 3 impls of waiting 
for semaphore with timeout.
POSIX have sem_timedwait(). Windows' WaitForMultipleObjectsEx() have timeout 
arg. SysV have semtimedop().
That's what we need to add something like LWLockAcquireWithTimeout().

Does adding all these stuff sound like a good tradeoff for lock-safe 
pg_stat_statements? If so - I'll start to implement this.

Best regards, Andrey Borodin.

Reply via email to