From owner-freebsd-threads@FreeBSD.ORG Tue Mar 30 10:03:24 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05EDC16A4CE for ; Tue, 30 Mar 2004 10:03:24 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id C20FC43D1F for ; Tue, 30 Mar 2004 10:03:23 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.11/8.12.11) with ESMTP id i2UI3NLh057895; Tue, 30 Mar 2004 10:03:23 -0800 (PST) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.11/8.12.11/Submit) id i2UI3NTa057894; Tue, 30 Mar 2004 10:03:23 -0800 (PST) (envelope-from marcel) Date: Tue, 30 Mar 2004 10:03:23 -0800 From: Marcel Moolenaar To: Doug Rabson Message-ID: <20040330180323.GA57824@ns1.xcllnt.net> References: <200403300935.49999.dfr@nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403300935.49999.dfr@nlsystems.com> User-Agent: Mutt/1.5.5.1i cc: freebsd-threads@freebsd.org Subject: Re: Thread Local Storage X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 18:03:24 -0000 On Tue, Mar 30, 2004 at 09:35:49AM +0100, Doug Rabson wrote: > > > > > > I'd quite like to see us use it for stuff like errno, _res and > > > other uglification currently in libc. Not until the 6.x timeframe > > > though. > > > > I'd like to see libc free of TLS ;-) The _res stuff can be > > avoided by modifying the implementation to use thread-safe > > APIs. The current _res stuff can _almost_ be eliminated > > by passing using pthread_getspecific() once and passing > > the _res around internal APIs. That's actually a pretty > > simple change. > > Unfortunately pthread_setspecific() and pthread_getspecific() don't work > for non-threaded programs whereas 'int __thread errno' works anywhere. Yes. It's also far more optimal. > It would even work for evil cases where libpthread is loaded after > program startup with dlopen. Yup. I think it's important to have it work. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net