Re: Function written in C, hangs on one machine and not another... - Mailing list pgsql-general

From Douglas McNaught
Subject Re: Function written in C, hangs on one machine and not another...
Date
Msg-id m2sluliqew.fsf@Douglas-McNaughts-Powerbook.local
Whole thread Raw
In response to Re: Function written in C, hangs on one machine and not another...  (Dennis Jenkins <dennis.jenkins@sbcglobal.net>)
Responses Re: Function written in C, hangs on one machine and not another...  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Dennis Jenkins <dennis.jenkins@sbcglobal.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

pgsql-general by date:

Previous
From: Dennis Jenkins
Date:
Subject: Re: Function written in C, hangs on one machine and not another...
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Function written in C, hangs on one machine and not another...