Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 520 invoked from network); 6 Sep 2007 12:32:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2007 12:32:47 -0000 Received: (qmail 16034 invoked by uid 500); 6 Sep 2007 12:32:36 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 16022 invoked by uid 500); 6 Sep 2007 12:32:36 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 16011 invoked by uid 99); 6 Sep 2007 12:32:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 05:32:36 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pharkins@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO py-out-1112.google.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2007 12:32:33 +0000 Received: by py-out-1112.google.com with SMTP id a25so293369pyi for ; Thu, 06 Sep 2007 05:32:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=J5Xm6EzOJRkovN3+zxjqKsKBQhFzyud/6TPBwMNv4pA=; b=V9VWIF863Ti8xDe1LTeF0jn9nFpLcwR6ZoU/hrBKV6KmuzXrwoRp3yEeY2yEmZfNhJ4lu7AzaXsggtTmL4b6R4TeX4vQ+98RpU35+TIjbv35kY1kmW6C0iMpEWF7NLX4HuE1enBa1TGlOOCV6T8+6NmghPJfwIbFVR4yRt8k2Vg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=UegqtaaOXfCeWkpq/JMcW1hpZlBTEr33LpVweTW32WGATnVTSi8pe+EQ5PMp9x0CghDV3Lfk3I6UXnyVw79qO5s0vx+7iGnbnTJOqPkSMisHs2Q/1uAkO5twVmQiWz4LIpkQ34YOQtOm7fQN3tYEFnYxzu5MbRiF4qYvBImbCu8= Received: by 10.65.233.16 with SMTP id k16mr1038473qbr.1189081931662; Thu, 06 Sep 2007 05:32:11 -0700 (PDT) Received: by 10.64.193.15 with HTTP; Thu, 6 Sep 2007 05:32:11 -0700 (PDT) Message-ID: <66887a3d0709060532t7e13ac9cs5857edfe6114156f@mail.gmail.com> Date: Thu, 6 Sep 2007 08:32:11 -0400 From: "Perrin Harkins" Sender: pharkins@gmail.com To: "David Willams" Subject: Re: global vs multi-process Cc: modperl@perl.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <66887a3d0709052210j35818533h53d7eeeef316dd9e@mail.gmail.com> <66887a3d0709052247t69238eb4le7368d26fae97c4b@mail.gmail.com> X-Google-Sender-Auth: 1ebcade29923279d X-Virus-Checked: Checked by ClamAV on apache.org On 9/6/07, David Willams wrote: > Obviously, I'm not involved with apache internals, but are you saying it's > architecturally impossible for apache to somehow manage a hash that can, at > the same time, be available (read-only) to child processes? There are things for apache that work similarly to Cache::FastMmap, using memory-mapped files to share data. The hard part is using that efficiently from perl (or really anything that isn't C). When you want to read/write perl structures as a series of bytes, you have to deal with serialization and minimizing the amount of data to be read/written. Many of the slow perl modules like IPC::Shareable will just naively serialize an entire hash any time you change a key, which would be a total disaster for an application like yours. Because it has a good caching system, BerkeleyDB essentially accomplishes a shared memory hash, although it still has the overhead of serializing individual values from perl into something C can deal with. Cache::FastMmap does too, but it shouldn't be used as a database because it's designed to work as a cache and drop data as needed. - Perrin