Question regarding Perl, DBI, and fork()

Поиск
Список
Период
Сортировка
От Allen Landsidel
Тема Question regarding Perl, DBI, and fork()
Дата
Msg-id 6.0.0.22.0.20031026145720.0249d258@pop.hotpop.com
обсуждение исходный текст
Ответы Re: Question regarding Perl, DBI, and fork()
Список pgsql-general
I have a job-processing backend written in perl, talking to a (of course)
postgres database.  The perl app has a master process that checks the
database periodically for jobs that need processed.  When there are
available jobs, it grabs some number of them (up a few hundred), and
fork()'s to create job processing processes, one per job, again up to a few
hundred.

I know the child processes inherit the db handle, as I learned the hard way
about InactiveDestroy ;) so my question is this:

Can the children (safely) use this handle to run database queries, or
should I just consider the handle garbage?  I didn't want to "just try and
see" because there's always the possibility it could work "by accident"
during the low-load testing, and fail at some other time.

Relevant versions of everything are:

FreeBSD 4.8 (Tracking RELENG_4, now 4.9-RC)
PostGreSQL 7.3.4
perl 5.003 (FreeBSD default)
perl DBI 1.37
perl DBD::Pg 1.22

I'm on the list, CC directly only if you're bored.  Thanks.

-Allen


В списке pgsql-general по дате отправления:

Предыдущее
От: Lynn.Tilby@asu.edu
Дата:
Сообщение: Re: no records returned
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: incrementing and decrementing dates by day increments programmatically