From: Tom Lane <tgl@sss.pgh.pa.us>
To: Einar Már Björvinsson <emb@media.is>
Cc: pgsql-general@postgresql.org
Subject: Re:
Date: Sun, 07 Nov 2004 20:13:45 -0500
Message-ID: <25493.1099876425@sss.pgh.pa.us> (raw)
In-Reply-To: <FF8C432C9271C24F849B585F2C50A71EF287@grunnur.media.is>
References: <FF8C432C9271C24F849B585F2C50A71EF287@grunnur.media.is>
=?iso-8859-1?Q?Einar_M=E1r_Bj=F6rvinsson?= <emb@media.is> writes:
> The program starts by opening a connection to the database, enter the =
> infinite while loop to run some functions.=20
> Inside the while loop it forks many childs which then call one function =
> from the library I made.
Are you trying to say that you are opening a database connection in the
parent process and passing it down for the children to play around with?
This is a fairly bad idea, unless you have an interlock mechanism to
ensure that only one child uses it at a time.
> It is as if the handle to the connection is not valid any more.=20
Perhaps the child is closing the connection when it's done with it.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, emb@media.is
Subject: Re:
In-Reply-To: <25493.1099876425@sss.pgh.pa.us>
References: <FF8C432C9271C24F849B585F2C50A71EF287@grunnur.media.is> <25493.1099876425@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox