From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27862 invoked by alias); 26 Aug 2004 09:58:10 -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 27829 invoked from network); 26 Aug 2004 09:58:09 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 26 Aug 2004 09:58:09 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 237BEB03D75 for ; Thu, 26 Aug 2004 11:58:09 +0200 (CEST) Date: Thu, 26 Aug 2004 09:58:00 -0000 From: Thorsten Kukuk To: libc-hacker@sources.redhat.com Subject: Questions about __thread for NSS modules Message-ID: <20040826095808.GA6880@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: SuSE Linux AG, Nuernberg, Germany User-Agent: Mutt/1.5.6i X-SW-Source: 2004-08/txt/msg00075.txt.bz2 Hi, currently there is still on problem left with NIS and threads: If for exmaple two concurrent threads calls getpwent_r() and NIS is used, than both threads will not see all NIS passwd entries. The reason is, that I need some static data to loop through the NIS map. I use locks while the process is inside of this functions, but I cannot hold a lock over different function calls. So, if the following happens: thread1 -> getpwent_r() thread2 -> getpwent_r() thread1 -> getpwent_r() thread2 -> getpwent_r() thread1 will never see the users thread2 gets, and thread2 will never see the users thread1 will get. The reason is, that you always needs to send the last entry you got back to get a new one, but thread2 will use the last entry thread1 got. One idea I had is to use thread local variables instead with NPTL. My question is: is this possible at all in NSS modules like libnss_nis.so? Do I need to link against libpthread? My first try ends in a unresolved "__tls_get_addr" symbol when I try to link the module. Thorsten -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B