Re: dynamic background workers, round two

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dynamic background workers, round two
Date: 2013-08-17 16:08:17
Message-ID: CA+TgmoakmgbuZ_omgsHrHHvxxJTcr1Sq9kmGL0v5WR+vvg2aDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Aug 11, 2013 at 1:31 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> So, I'd suggest something like:
>
> typedef enum BgwHandleStatus {
> BGWH_SUCCESS, /* sucessfully got status */
> BGWH_NOT_YET, /* worker hasn't started yet */
> BGWH_GONE, /* worker had been started, but shut down already */
> BGWH_POSTMASTER_DIED /* well, there you go */
> } BgwHandleStatus;
>
>
> BgwHandleStatus GetBackgroundWorkerPid(BackgroundWorkerHandle *handle, pid_t *pid);
> BgwHandleStatus WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pid);

OK, here's a patch that API. I renamed the constants a bit, because a
process that has stopped is not necessarily gone; it could be
configured for restart. But we can say that it is stopped, at the
moment.

I'm not sure that this API is an improvement. But I think it's OK, if
you prefer it.

...Robert

Attachment Content-Type Size
bgworker-feedback-v2.patch application/octet-stream 23.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-08-17 18:04:24 Re: Fix Windows socket error checking for MinGW
Previous Message Robert Haas 2013-08-17 15:55:10 Re: StrategyGetBuffer optimization, take 2