From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17635 invoked by alias); 17 Jan 2004 01:39:00 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 17615 invoked from network); 17 Jan 2004 01:39:00 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 17 Jan 2004 01:39:00 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i0GNTWxL009725; Sat, 17 Jan 2004 00:29:32 +0100 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i0GNTV5b009721; Sat, 17 Jan 2004 00:29:31 +0100 Date: Sat, 17 Jan 2004 01:39:00 -0000 From: Jakub Jelinek To: Roland McGrath Cc: davidm@hpl.hp.com, GNU libc hackers Subject: Re: enabling caching for dl_iterate_phdr() Message-ID: <20040116232931.GL6413@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <16387.9755.753294.37588@napali.hpl.hp.com> <200401170057.i0H0vQag022225@magilla.sf.frob.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401170057.i0H0vQag022225@magilla.sf.frob.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-01/txt/msg00064.txt.bz2 On Fri, Jan 16, 2004 at 04:57:26PM -0800, Roland McGrath wrote: > > In any case, if a callback-based approach is preferred, I can live > > with that, too. > > I don't claim it's the best interface. But that is the approach that > doesn't have other blocking issues right now. How about extending struct dl_phdr_info and passing an counter in it to dl_iterate_phdr's callback? The structure can be extended at the end, because dl_iterate_phdr passes its size to the callback as well. The callback is called with dl_load_lock held, so the counter doesn't even have to be atomic. libgcc_s would just see if size includes the additional field in the first callback, if yes, it would record that counter and on subsequent dl_iterate_phdr call it would first check whether the counter did not change and if it is the same, it could use cached info. Jakub