Re: fork() and dynamically loaded c functions.... - Mailing list pgsql-general

From Jay Flattery
Subject Re: fork() and dynamically loaded c functions....
Date
Msg-id 228368.49208.qm@web120109.mail.ne1.yahoo.com
Whole thread Raw
In response to Re: fork() and dynamically loaded c functions....  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: fork() and dynamically loaded c functions....  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thanks for your reply


>> I now fork() a process in _PG_Init() (both processes interact), but when I
>> shutdown postgre I get: LOG:  failed to find proc 0x1331110 in ProcArray

>What exactly is that child process doing?  It sure sounds like it thinks
>it's a valid backend.

Actually it's not doing anything, as I'm just trying to work it all out - just a

bunch of printfs and waits.
But the library is a PG_MAGIC_MODULE.

I tried killing it with pg_terminate_backend(pid) - but I get WARNING:   PID
1166738497 is not a PostgreSQL server process. (Interestingly the  child
pid=28629, which was printed in the line before)

>You can fork something if you like, but it had absolutely better not
>touch any part of shared memory afterwards.

Sure - it is intended to run independently.

Is there an internal pfork() or something similar I should use instead?






pgsql-general by date:

Previous
From: Eric Ridge
Date:
Subject: Re: Read Committed Transaction Isolation and SELECT ... UNION ... SELECT
Next
From: Tom Lane
Date:
Subject: Re: fork() and dynamically loaded c functions....