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 1tOfOe-007vAA-4n for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 15:58:36 +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 1tOfOd-00DAZi-E2 for pgsql-general@arkaria.postgresql.org; Fri, 20 Dec 2024 15:58:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tOfOd-00DAYi-3H for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 15:58:34 +0000 Received: from mail-oo1-xc31.google.com ([2607:f8b0:4864:20::c31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tOfOa-000mCr-1u for pgsql-general@lists.postgresql.org; Fri, 20 Dec 2024 15:58:34 +0000 Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-5f2d7868ef0so539008eaf.3 for ; Fri, 20 Dec 2024 07:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734710310; x=1735315110; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=sbwfHU4aGjXyets8Vrp77KMNfseLSaxiCE7l5/W3vL8=; b=TU4PsygqbZMSPQSZqaUqmbNJ7b3T7yaIMARRlvgATrkFi3esznTD/4mgUFC0CL7jfK d5CrEyg7PLJ1wHQ/7vU6y5z947THmAr7IdjpOGnZsflaKOB9ICYL7AjbzZmk2ySWimEM oXGl+j5ky/bGIoqMHzrmFZxuVwBHK6RRYxWpVSjxdLjtayixr0S+a8QrmCDNaCNzIkxM gqDXufp6SfO67vQjPB58Kng+UNfojCisVu2JrmldT7GqqSuVPrJRS6Wr3uniMkWMwGix LyNE3ritAsHxd+QYQvcIdr25wbqi6choQliw6vBMUt/92DpHUY/XYKJYx9WVcBldaOXt 9qwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734710310; x=1735315110; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=sbwfHU4aGjXyets8Vrp77KMNfseLSaxiCE7l5/W3vL8=; b=WQY/MVSidrDiGfGP4Modmsb0GcS7Y9c//2kWdODzqUTZxsz9wCIeHeE2EyKYPkx4iI 4HFy9kjempiz0y3FBCnXhZ2N1lbRKY6k5mLNTeBUN4Gp8dZUO0RLOMQX5+fzm7GeFMLU 0xxNd8Iw/a3zOKUW2J8Z2KSTyCnKmv4DIh1NaVpvjI1Y6lHlKtgKB6cnbIabH4m5SEDX UXkR5P4Dh2Kd/hV5KGefZBX6qB/K/gIgjmCZDWXBVg1M7yFHfxOiLpw56LEXSTGWPc5k XdBFNlLc+p96RGs3ejJgCDQCp0Gm8kcoNNKbrMZKYpnr0gWWBcH52v5CngvYImQmJf0q xcnA== X-Gm-Message-State: AOJu0YwulESAKoo5ZXOIjcWcITzstq8ncOjGq9KxdweefHiuaKfFo/zm 2X107kcLG0wMKxA4i+9rHD3I9A6N/xcQ17ef9Y94me2+Mf49eCZGTbch5QyPS3egnemulUwxtus b5YyhxIlDQswXyhr78v+rhkAKXghVpw== X-Gm-Gg: ASbGncuzEbjO4TdAKdSj9041qPSj9nY6GxbSkUYpZk16vk+pSvMrLGkklRY0ZYGr0P5 f5/Uv9jR/cIBIMxxa/0bJQ50ykJu5UWYpI0lP X-Google-Smtp-Source: AGHT+IG4tkykNbcxAG/erqd0PKNEY782b1PgR5XFa6gcNrQjDFdfi5G0ogKl6XoZgg3r7CYL5CNpW5AsBu3w33nTzr0= X-Received: by 2002:a05:6871:a10d:b0:296:dd1d:ce73 with SMTP id 586e51a60fabf-2a7faac847bmr2122906fac.0.1734710309951; Fri, 20 Dec 2024 07:58:29 -0800 (PST) MIME-Version: 1.0 From: Luca Ferrari Date: Fri, 20 Dec 2024 16:57:53 +0100 Message-ID: Subject: passing a pointer from a BackgroundWorker to a DynamicBackgroundWorker To: pgsql-general Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi all, I've a doubt about background workers. I've a worker (loaded by a module via shared_preloaded_libraries) should register a dyanmic background worker per database, in a manner similar to what autovacuum does. I would like to pass to these dynamic background workers a pointer to a custom struct, that has been allocated and initialized by the "main" background worker. Is it sage to pass the pointer via the Datum main argument from one worker to another? Clearly, the struct has be allocated in a shared memory segment,but I'm not sure in which context. Any suggestion is appreciated. Thanks, Luca