Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:23128 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2117 invoked by uid 1010); 3 May 2006 16:07:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 2101 invoked from network); 3 May 2006 16:07:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2006 16:07:22 -0000 X-Host-Fingerprint: 69.12.155.129 talos.alphaweb.net Received: from ([69.12.155.129:6495] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 0C/A3-63443-835D8544 for ; Wed, 03 May 2006 12:07:20 -0400 Message-ID: <0C.A3.63443.835D8544@pb1.pair.com> To: internals@lists.php.net References: <44587268.9020909@gmail.com> Date: Wed, 3 May 2006 09:06:43 -0700 Lines: 28 Organization: PHP X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Response X-Posted-By: 69.12.155.129 Subject: Re: Shared hashtable From: pollita@php.net ("Sara Golemon") > I'm being asked about the possibility of creating an extension that will > cache some data from a MySQL DB in-memory. I've been reading various > online resources regarding building extensions and cannot find an answer > to the following question... Is there a way to create a hashtable in the > extension which will be available to all of the Apache children without > resorting to shared memory? > You want to *share* something in *memory* between two processes. Yep, ya pretty much need shared memory... > It's important that only one instance of the data exists for two > reasons... 1) It's a fairly large amount of data and 2) it will change as > the application runs. I've created a small test extension using > MODULE_GLOBALS the results of which suggest that these variables are per > process. I'm just looking for some confirmation that shared memory is the > way to go before I jump down that particular black hole. > Yes, Module Globals are per-process (or per-thread if your under a threaded sapi). In either case, these are specifically designed to *prevent* concurrent requests from accessing the same data. -Sara > TIA. > > -Stut