Re: connection file descriptors created with identical number after process fork on mac
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: connection file descriptors created with identical number after process fork on mac |
| Дата | |
| Msg-id | 24744.1470266400@sss.pgh.pa.us обсуждение |
| Ответ на | connection file descriptors created with identical number after process fork on mac (Chris Withers <chris@simplistix.co.uk>) |
| Ответы |
Re: connection file descriptors created with identical
number after process fork on mac
|
| Список | pgsql-general |
Chris Withers <chris@simplistix.co.uk> writes:
> I'm writing some multi-process code in Python and trying to make sure I
> open a new connection for each process. Here's the really cut down code:
> ...
> What's really surpising to me is the output on a mac:
> $ python psycopg2_multiprocess.py
> 44276 child fd: 13
> 44277 child fd: 13
> 44278 child fd: 13
> 44279 child fd: 13
> The getpid() output indicates that the connec() call is being made
> inside a different process each time, yet the connection appears to
> still be using the same fd.
FD numbers are process-local in all flavors of Unix. The above only
proves that all of these processes had FDs 0..12 open already, which
doesn't seem terribly surprising.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера