Re: [HACKERS] background workers, round three

2013-10-16 Thread Robert Haas
On Tue, Oct 15, 2013 at 4:02 PM, Kohei KaiGai kai...@kaigai.gr.jp wrote: Hmm. It probably allows to clean-up smaller fraction of data structure constructed on dynamic shared memory segment, if we map / unmap for each transactions. I think the primary use of dynamic shared memory will be for

Re: [HACKERS] background workers, round three

2013-10-15 Thread Kohei KaiGai
2013/10/14 Robert Haas robertmh...@gmail.com: * ephemeral-precious-v1.patch AtEOXact_BackgroundWorker() is located around other AtEOXact_* routines. Doesn't it makes resource management complicated? In case when main process goes into error handler but worker process is still running in

Re: [HACKERS] background workers, round three

2013-10-14 Thread Robert Haas
On Fri, Oct 11, 2013 at 9:27 AM, Michael Paquier michael.paqu...@gmail.com wrote: Few comments about the code: 1) In postmaster.c, what about adding a comment here telling that we can forget about this bgworker as it has already been requested for a termination: + if

Re: [HACKERS] background workers, round three

2013-10-14 Thread Robert Haas
On Sat, Oct 12, 2013 at 4:53 PM, Kohei KaiGai kai...@kaigai.gr.jp wrote: I briefly checked these patches. Let me add some comments. Thanks! * terminate-worker-v1.patch TerminateBackgroundWorker() turns on slot-terminate flag under LW_SHARED lock. Is it reasonable because all the possible

Re: [HACKERS] background workers, round three

2013-10-12 Thread Kohei KaiGai
I briefly checked these patches. Let me add some comments. * terminate-worker-v1.patch TerminateBackgroundWorker() turns on slot-terminate flag under LW_SHARED lock. Is it reasonable because all the possible caller is the background worker process itself, isn't it? * ephemeral-precious-v1.patch

Re: [HACKERS] background workers, round three

2013-10-11 Thread Michael Paquier
Hi, Finally I got the chance to put my hands on this code. Really sorry for the late replay. On Fri, Sep 13, 2013 at 10:42 AM, Robert Haas robertmh...@gmail.com wrote: Last week, I attempted to write some code to perform a trivial operation in parallel by launching background workers. Despite

Re: [HACKERS] background workers, round three

2013-10-11 Thread Robert Haas
On Fri, Oct 11, 2013 at 9:27 AM, Michael Paquier michael.paqu...@gmail.com wrote: Finally I got the chance to put my hands on this code. Really sorry for the late replay. Thanks for the review. I'll respond to this in more detail later, but to make a long story short, I'm looking to apply

[HACKERS] background workers, round three

2013-09-12 Thread Robert Haas
Last week, I attempted to write some code to perform a trivial operation in parallel by launching background workers. Despite my earlier convictions that I'd built enough infrastructure to make this possible, the experiment turned out badly - so, patches! It's been pretty obvious to me from the