Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c |
| Дата | |
| Msg-id | 18313.1034714538@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c (Bruce Momjian <pgman@candle.pha.pa.us>) |
| Ответы |
Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
|
| Список | pgsql-hackers |
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> That is odd; seems like you should get between 1 and 2 seconds. How
>> were you measuring the delay, exactly?
> Remember, that if you add 1, the select() is going to get tv_sec = 2, so
> yes, it will be two seconds.
Yeah, but only if the value isn't recalculated shortly later. Consider
caller computes finish_time = time() + timeout;
...
inside select-wait loop, compute max_delay = finish_time - time();
If the time() value has incremented by 1 second between these two lines
of code, you have a problem with a 1-second timeout...
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера