Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 40472 invoked from network); 18 Jul 2005 20:40:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Jul 2005 20:40:28 -0000 Received: (qmail 62359 invoked by uid 500); 18 Jul 2005 20:40:18 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 62272 invoked by uid 500); 18 Jul 2005 20:40:18 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 62232 invoked by uid 99); 18 Jul 2005 20:40:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2005 13:40:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [66.221.212.168] (HELO highlandsun.propagation.net) (66.221.212.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jul 2005 13:40:13 -0700 Received: from [127.0.0.1] (highlandsun.com [66.221.212.169]) by highlandsun.propagation.net (8.13.3/8.13.3) with ESMTP id j6IKe9kV009163 for ; Mon, 18 Jul 2005 15:40:10 -0500 Message-ID: <42DC13A6.3020909@symas.com> Date: Mon, 18 Jul 2005 13:40:06 -0700 From: Howard Chu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050621 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: apr_rmm, apr_anylock_t Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi there, I've written an authorization module that uses cookies to track authorization state (for Apache 2.0.54). I'm using apr_shm to create a shared memory region to hold the state info (and just putting a session ID in the actual cookie). Using apr_rmm to manage the records seems to work OK, but my current code has a number of issues and I'm not sure where to look next. I've created a apr_global_mutex_t to serialize access to the shared memory. It looks like I should have been able to use this apr_anylock_t but I haven't found any code examples of how to create/initialize one. It appears that apr_rmm protects itself with an anylock but none of the examples I've found ever pass one in to apr_rmm_init(). Also, while the apr_anylock_t appears to accomodate a variety of process/thread locks, it doesn't seem intended for use with a apr_global_mutex_t. Is that right? It seems that I need to register a cleanup handler for this rmm region, but I don't know where or why. I just know that when I terminate the httpd process, "ipcs" shows a bunch of semaphores hanging around. If I start and stop httpd a few times (typical during a debugging session) the number of semaphores keeps growing and eventually httpd fails to startup because it can't allocate any more. I've already registered a cleanup handler for my global_mutex, but that didn't solve the problem. I still have an unresolved question about what to do if someone changes the size of the shared memory cache in the config file and restarts the server. In my current code that change will just be ignored, unless you stop the server and delete the existing memory region first. Any suggestions? -- -- Howard Chu Chief Architect, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc OpenLDAP Core Team http://www.openldap.org/project/