From owner-freebsd-arch Tue Feb 4 12: 5:45 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 ADF4B37B401; Tue, 4 Feb 2003 12:05:43 -0800 (PST) Received: from corbulon.video-collage.com (corbulon.video-collage.com [64.35.99.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDAE143E4A; Tue, 4 Feb 2003 12:05:39 -0800 (PST) (envelope-from mi+mx@aldan.algebra.com) Received: from mi.us.murex.com (250-217.customer.cloud9.net [168.100.250.217]) by corbulon.video-collage.com (8.12.7/8.12.7) with ESMTP id h14K5RM3067126 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL); Tue, 4 Feb 2003 15:05:31 -0500 (EST) (envelope-from mi+mx@aldan.algebra.com) Content-Type: text/plain; charset="iso-8859-1" From: Mikhail Teterin Organization: Virtual Estates, Inc. To: Max Khon Subject: Re: dlclose() vs. atexit() Date: Tue, 4 Feb 2003 15:05:53 -0500 User-Agent: KMail/1.4.3 Cc: arch@freebsd.org, Alfred Perlstein , Wes Peters , Mario Sergio Fujikawa Ferreira References: <200302030506.h1356Nha011918@repoman.freebsd.org> <200302041046.13767.mi+mx@aldan.algebra.com> <20030205014229.A62172@iclub.nsu.ru> In-Reply-To: <20030205014229.A62172@iclub.nsu.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200302041505.53352.mi+mx@aldan.algebra.com> X-Scanned-By: MIMEDefang 2.21 (www . roaringpenguin . com / mimedefang) 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 Tuesday 04 February 2003 02:42 pm, Max Khon wrote: = hi, there! = = > 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... = = this will break applications which want to reload some = of the dlopen'ed modules I guess, I'm especially slow today. How will it break them? That is what Solaris appears to be doing, BTW -- calling the exit-handler at dlclose(), but leaving the library in memory: SunOS [...] 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-280R Loading the libraries ./l0.so loaded as ff3a1458 ./l1.so loaded as ff3a17b8 Library 0 calling atexit(ff260380) Library 1 calling atexit(ff350380) Unloading the libraries Exit handler ff350380 of library 0 is invoked ff3a1458 unloaded Exit handler ff260380 of library 1 is invoked ff3a17b8 unloaded Libraries unloaded. Returning See, the exit handler for library 1 is called and does not crash, even though it is defined in the already dlclosed library 0... -mi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message