Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 24233 invoked from network); 15 Aug 2006 01:33:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Aug 2006 01:33:06 -0000 Received: (qmail 73310 invoked by uid 500); 15 Aug 2006 01:33:06 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 72945 invoked by uid 500); 15 Aug 2006 01:33:05 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 72934 invoked by uid 99); 15 Aug 2006 01:33:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 18:33:04 -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 [212.18.32.4] (HELO out-1.mail.amis.net) (212.18.32.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Aug 2006 18:33:03 -0700 Received: from in-1.mail.amis.net (in-1.mail.amis.net [212.18.32.15]) by out-1.mail.amis.net (Postfix) with ESMTP id E02075BACFE for ; Tue, 15 Aug 2006 03:32:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by in-1.mail.amis.net (Postfix) with ESMTP id B89092D75B0 for ; Tue, 15 Aug 2006 03:32:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at amis.net X-Spam-Score: -0.438 X-Spam-Level: Received: from in-1.mail.amis.net ([127.0.0.1]) by localhost (in-1.mail.amis.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tYN3Y6pbW5Th for ; Tue, 15 Aug 2006 03:32:37 +0200 (CEST) Received: from smtp.amis.net (smtp.amis.net [212.18.32.41]) by in-1.mail.amis.net (Postfix) with ESMTP id 812002D75A3 for ; Tue, 15 Aug 2006 03:32:37 +0200 (CEST) Received: from mithril.xbc.nu (cpe-213-157-226-100.dynamic.amis.net [213.157.226.100]) by smtp.amis.net (Postfix) with ESMTP id 34F13396801 for ; Tue, 15 Aug 2006 03:32:36 +0200 (CEST) Received: from [172.17.19.19] (silmaril.xbc.nu [172.17.19.19]) by mithril.xbc.nu (Postfix) with ESMTP id BBEC160FBE for ; Tue, 15 Aug 2006 03:32:36 +0200 (CEST) Message-ID: <44E1244E.6030602@xbc.nu> Date: Tue, 15 Aug 2006 03:33:02 +0200 From: =?UTF-8?B?QnJhbmtvIMSMaWJlag==?= User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: APR Development List Subject: Re: Problems with DSOs and Pools References: <7edfeeef0608110942h8caf669t96585359a5c61f17@mail.gmail.com> <20060814093826.GA11345@redhat.com> <7edfeeef0608141155q639c41detf46c8c653a47831f@mail.gmail.com> <20060814211502.GA24628@redhat.com> In-Reply-To: <20060814211502.GA24628@redhat.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.438 required=5 tests=[AWL=-0.020, BAYES_00=-2.599, FORGED_RCVD_HELO=0.135, RCVD_IN_SORBS_DUL=2.046] X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Joe Orton wrote: > On Mon, Aug 14, 2006 at 02:55:49PM -0400, Garrett Rooney wrote: > >> I'm really just hoping for a way to make DSO loaded libraries just the >> same as any other library, if they require a whole lot of backflips to >> use reliably, that seems like a problem to me. >> > > Of course, with DSOs there are some whole new lifetime issues to think > about - it *is* difficult, no doubt about it. Nesting pools properly > and avoiding "global" pools helps with constraining the DSO to its own > little short-lived world. > > I'm not seeing anything at all here which needs changing in APR; just > some application code which has not been designed in anticipation of > being used from a DSO. That is really not something which can or should > be fixed in APR. > This is all very well for applications, but for libraries this can be really, really difficult. I wouldn't say there's a bug in APR, but IMHO there's a huge usability problem. In the case of Subversion, we don't have much control over all the uses of our libraries and bindings. Yes, we control the command-line client, but that's really just a small part of the picture. Note that loading DSOs is not the only problem here; we have a similar issue in a case where we need a global cache, but have no control over when its created and -- most important -- when it's destroyed. We've managed to work around this particular case with horrible, hard to maintain tricks; but it would make our lives a lot easier if we could do away with them. It may not actually be necessary to add new functions to APR or anything. An acceptable solution might be to serialize allocations from the global pool, the way pool creation is serialized (IIRC). Allocating from the global pool doesn't happen very often, and if we could safely pass a NULL pool to apr_dso_load (or apr_hash_create, etc.), it think we could live with the potential performance penalty. -- Brane