Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rOJkI-003Bqc-21 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jan 2024 15:46:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rOJkH-002teY-5r for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Jan 2024 15:46:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rOJkG-002teQ-TC for pgsql-hackers@lists.postgresql.org; Fri, 12 Jan 2024 15:46:56 +0000 Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rOJkD-001CUM-FQ for pgsql-hackers@postgresql.org; Fri, 12 Jan 2024 15:46:55 +0000 Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-7bed9f3ca97so133880839f.1 for ; Fri, 12 Jan 2024 07:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705074413; x=1705679213; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=O9n97+SyIpvC0km4TWSh9BhcEhKENf5UX0NiH7PtDck=; b=B8h+4y0DmL2ZpPOJ4zz+DaAP+KJKA98xB6ZY8uZhaLKLRaEqHG0gssAgU5FQOR3MBX cTHr8+vcvTXRW4NpCrkZRQXlaIdgKFr7awboHL286weMT7YAEE64ZvApwP0B1QyWvOZl /MdVVlZE1KfaUfAArwqGNu5/klrh38tXFEtZqqS3e9PnnpmcJp62oQlKeE8Stzozois3 sExuu3PspdTRBH29+K3JbL8G6tpjYFEopZYXl8740P9sxgn2ukZ8l4vtkbsctgAWogLp njcxJa6NsrmoNOnUmf+1KIK+P4LJD7roSSUZRaqkBZy3VNWuCs4tfM6erFUZx5Ho2bsq H9Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705074413; x=1705679213; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O9n97+SyIpvC0km4TWSh9BhcEhKENf5UX0NiH7PtDck=; b=Uf0V1jIlBmW1Kbrppjjj90qcD9IxrqM6ZSm/vUuTKkw0NJur5sXAYKwVlDNZw8IbU5 5OMSqpnw6wDsTknhyOOvCYTUFS2j6PmqbuD5X4kw3Ejr1s4o4O2fPOcIjEhsSmflSlz4 O8hSLIrE+1iYshkRktVftuYpacuQe5CDHnKaChxccEUQ2zOj1X4OpREIad6cOOcHdAIi 3VN5gRt65/f96E4GJTPC1jVgIW9g3OmK9z28UcB7d761msnglfbAADxL+94FHjxHKGAH aoc28kHDwxn/RCcLgqcRE65uBG4EZq7RuWEqFryw93WhCtVsKTVQ0nyr51a8s3+wmr0z 4CXA== X-Gm-Message-State: AOJu0YxceP4JcDJBpMQS+aHGuu9O+PesICtIJ6qQ6wMHvM5X8ClnmhwL f0Gu5iWB3i/5RG4+ppWE+5Y= X-Google-Smtp-Source: AGHT+IG3YtznH9qwNiK14ZdyiXn25C3TyOcnTBoNAOrr24z3ouNCCXVvbdR5fSxT7DdGAewTgMW4vw== X-Received: by 2002:a5d:8509:0:b0:7be:ec9d:122f with SMTP id q9-20020a5d8509000000b007beec9d122fmr1511474ion.16.1705074412811; Fri, 12 Jan 2024 07:46:52 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id fa7-20020a056638618700b0046e4a8367c0sm944763jab.140.2024.01.12.07.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 07:46:52 -0800 (PST) Date: Fri, 12 Jan 2024 09:46:50 -0600 From: Nathan Bossart To: Aleksander Alekseev Cc: pgsql-hackers@postgresql.org Subject: Re: reorganize "Shared Memory and LWLocks" section of docs Message-ID: <20240112154650.GA3565306@nathanxps13> References: <20240112041430.GA3557928@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for reviewing. On Fri, Jan 12, 2024 at 05:12:28PM +0300, Aleksander Alekseev wrote: > """ > Any registered shmem_startup_hook will be executed shortly after each > backend attaches to shared memory. > """ > > IMO the word "each" here can give the wrong impression as if there are > certain guarantees about synchronization between backends. Maybe we > should change this to simply "... will be executed shortly after > [the?] backend attaches..." I see what you mean, but I don't think the problem is the word "each." I think the problem is the use of passive voice. What do you think about something like Each backend will execute the registered shmem_startup_hook shortly after it attaches to shared memory. > """ > should ensure that only one process allocates a new tranche_id > (LWLockNewTrancheId) and initializes each new LWLock > (LWLockInitialize). > """ > > Personally I think that reminding the corresponding function name here > is redundant and complicates reading just a bit. But maybe it's just > me. Yeah, I waffled on this one. I don't mind removing it. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com