Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-30 Thread Alvaro Herrera
Robert Haas wrote: > It might be better to document this in bgworker.sgml instead. That > already documents some facts about exiting: > > >If bgw_restart_time for a background worker is >configured as BGW_NEVER_RESTART, or if it exits with an exit >code of 0 or is terminated by

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-29 Thread Robert Haas
On Wed, Jun 29, 2016 at 4:35 PM, Piotr Stefaniak wrote: > On 2016-06-29 18:58, Robert Haas wrote: >> This code predates be7558162acc5578d0b2cf0c8d4c76b6076ce352, prior to >> which proc_exit(0) forced an immediate, unconditional restart. It's >> true that, given that

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-29 Thread Piotr Stefaniak
On 2016-06-29 18:58, Robert Haas wrote: This code predates be7558162acc5578d0b2cf0c8d4c76b6076ce352, prior to which proc_exit(0) forced an immediate, unconditional restart. It's true that, given that commit, changing this code to do proc_exit(0) instead of proc_exit(1) would be harmless.

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-29 Thread Robert Haas
On Mon, Jun 27, 2016 at 11:40 PM, Michael Paquier wrote: > On Tue, Jun 28, 2016 at 6:49 AM, Robert Haas wrote: >> On Sun, Jun 26, 2016 at 6:19 AM, Piotr Stefaniak >> wrote: while investigating the shm_mq code

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-27 Thread Michael Paquier
On Tue, Jun 28, 2016 at 6:49 AM, Robert Haas wrote: > On Sun, Jun 26, 2016 at 6:19 AM, Piotr Stefaniak > wrote: >>> while investigating the shm_mq code and its testing module I made some >>> cosmetic improvements there. You can see them in the

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-27 Thread Robert Haas
On Sun, Jun 26, 2016 at 6:19 AM, Piotr Stefaniak wrote: >> while investigating the shm_mq code and its testing module I made some >> cosmetic improvements there. You can see them in the attached diff file. > > Revised patch attached. The first hunk of this corrects

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-06-26 Thread Piotr Stefaniak
On 2016-05-16 21:40, Piotr Stefaniak wrote: Hello, while investigating the shm_mq code and its testing module I made some cosmetic improvements there. You can see them in the attached diff file. Revised patch attached. commit 3ff1afa84e4bc22f153c876e2f0588327a8a004e Author: Piotr Stefaniak

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-05-18 Thread Piotr Stefaniak
On 2016-05-17 19:05, Tom Lane wrote: Michael Paquier writes: On Tue, May 17, 2016 at 4:40 AM, Piotr Stefaniak wrote: -toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry) +toc_bytes = offsetof(shm_toc,

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-05-17 Thread Tom Lane
Michael Paquier writes: > On Tue, May 17, 2016 at 4:40 AM, Piotr Stefaniak > wrote: > -toc_bytes = offsetof(shm_toc, toc_entry) +nentry * sizeof(shm_toc_entry) > +toc_bytes = offsetof(shm_toc, toc_entry) + nentry *

Re: [HACKERS] A couple of cosmetic changes around shared memory code

2016-05-16 Thread Michael Paquier
On Tue, May 17, 2016 at 4:40 AM, Piotr Stefaniak wrote: > while investigating the shm_mq code and its testing module I made some > cosmetic improvements there. You can see them in the attached diff file. -toc_bytes = offsetof(shm_toc, toc_entry) +nentry *