Re: how to pass data (tuples) to worker processes? - Mailing list pgsql-hackers

From Andrew Tipton
Subject Re: how to pass data (tuples) to worker processes?
Date
Msg-id CA+M2pVUxk5OP3y==LL+v_P7zrr2qAF6ZpTfpQAbN4z7h_CjQvw@mail.gmail.com
Whole thread Raw
In response to Re: how to pass data (tuples) to worker processes?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: how to pass data (tuples) to worker processes?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Sat, Aug 3, 2013 at 5:43 AM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Tomas Vondra wrote:

> I'm learning how to use the "background worker processes" commited in
> 9.3. The usage basics are quite nicely illustrated in the worker_spi
> extension (kudos to those who designed the feature / extension).

Thanks!

> I'm not quite sure how to pass data between the regular backend and a
> worker. Implementing the channel (socket/pipe/...) itself is not a big
> deal, that's IPC 101, but deciding which data to copy (and how) is.
>
> [...]

Were you able to figure it out?  If so, would you share?

I'm also in the middle of doing some experiments with bgworkers, and for me it's the IPC part that's proving tricky.  I'd love to have a simple socket that can be used to communicate with the bgworker.  But because the bgworker is launched by the postmaster -- and not the backend which registers it -- there's no chance for the bgworker to inherit one end of the socketpair().

Tomas:  in the end, what approach did you use for IPC?

Robert:  any chance you could share a few more details on the enhancements you're planning for bgworkers?  I seem to recall reading that communicating with the dynamic bgworkers after they had been launched was next on your agenda...


Regards,
Andrew Tipton

pgsql-hackers by date:

Previous
From: Satoshi Nagayasu
Date:
Subject: Re: inconsistent state after crash recovery
Next
From: Dimitri Fontaine
Date:
Subject: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])