From owner-freebsd-arch Tue Feb 4 8:25:21 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDCE437B401 for ; Tue, 4 Feb 2003 08:25:19 -0800 (PST) Received: from arpa.com (arpa.com [199.245.173.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8343743F75 for ; Tue, 4 Feb 2003 08:25:19 -0800 (PST) (envelope-from wd@arpa.com) Received: from localhost (localhost [127.0.0.1]) by arpa.com (Postfix) with ESMTP id C9D84CAA for ; Tue, 4 Feb 2003 10:25:13 -0600 (CST) Received: by arpa.com (Postfix, from userid 102) id 2DBBCCA7; Tue, 4 Feb 2003 10:25:13 -0600 (CST) Date: Tue, 4 Feb 2003 10:25:13 -0600 From: Chip Norkus To: arch@freebsd.org Subject: Re: dlclose() vs. atexit() Message-ID: <20030204162513.GB22642@arpa.com> References: <200302030506.h1356Nha011918@repoman.freebsd.org> <1044319099.358.57.camel@zaphod.softweyr.com> <20030204082625.GB85104@elvis.mu.org> <200302041046.13767.mi+mx@aldan.algebra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302041046.13767.mi+mx@aldan.algebra.com> User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS snapshot-20020531 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue Feb 04, 2003; 10:46AM -0500 Mikhail Teterin propagated the following: [snip] > > Yet another plan would be to have the atexit() call simply increase the > ref-count of the library a handler is from, so it will not actually be > unloaded by dlclose(). But that will be yet another implementation... > I'm not sure this would be a good idea. I have a program which uses dynamic libraries to introduce code, and which can unload or reload them at any time and keep on running. I am especially worried about the reload case, because what often happens is that an old version of the .so is unloaded (dlclosed) and then a new version is loaded (dlopened). If the old version stays around, I'm afraid there would be some symbol collision. Correct me if I'm wrong, though. I think the Solaris approach you mentioned above is by far the best and most correct sounding approach. > -mi > -wd -- chip norkus; unix geek and programmer; wd@arpa.com "question = (to) ? be : !be;" --Shakespeare http://telekinesis.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message