Re: Function written in C, hangs on one machine and not another...

From: Douglas McNaught <doug(at)mcnaught(dot)org>
To: Dennis Jenkins <dennis(dot)jenkins(at)sbcglobal(dot)net>
Cc: postgresql listserv <pgsql-general(at)postgresql(dot)org>
Subject: Re: Function written in C, hangs on one machine and not another...
Date: 2005-10-28 15:59:03
Message-ID: m2sluliqew.fsf@Douglas-McNaughts-Powerbook.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dennis Jenkins <dennis(dot)jenkins(at)sbcglobal(dot)net> writes:

> Is it safe for the postgres engine to fork()? Would
> the child need to close down anything immediately in
> its main() to avoid corrupting the parent?

I *think* (Tom may correct me) that as long as you don't call into the
backend code at all in the child process, and don't write to any file
descriptors other than (properly set-up) stdin and stdout, you'd be
OK. The safest thing to do would be to exec() a separate binary that
does the parsing, but that would incur an additional performace
penalty.

-Doug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-28 16:36:56 Re: Function written in C, hangs on one machine and not another...
Previous Message Dennis Jenkins 2005-10-28 15:18:23 Re: Function written in C, hangs on one machine and not another...