Re: Background Processes in Postgres Extension - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Background Processes in Postgres Extension
Date
Msg-id 3384911.1713887967@sss.pgh.pa.us
Whole thread Raw
In response to Background Processes in Postgres Extension  (Sushrut Shivaswamy <sushrut.shivaswamy@gmail.com>)
Responses Re: Background Processes in Postgres Extension
List pgsql-hackers
Sushrut Shivaswamy <sushrut.shivaswamy@gmail.com> writes:
> I'm developing a postgres extension as a custom Table Interface method
> definition.
> WIthin the extension, I"m planning to create two background processes using
> `fork()` that will process data in the background.

> Are there any recommendations / guidelines around creating background
> processes within extensions in postgres?

fork() is entirely the wrong way to do it, mainly because when the
creating session exits the postmaster will be unaware of those
now-disconnected child processes.  See the mechanisms for creating
background worker processes (start with bgworker.h).

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: slightly misleading Error message in guc.c
Next
From: Nathan Bossart
Date:
Subject: Re: Popcount optimization using AVX512