From owner-freebsd-threads@FreeBSD.ORG Tue Jun 17 15:39:44 2003 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 AB52437B401 for ; Tue, 17 Jun 2003 15:39:44 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id D128D43F3F for ; Tue, 17 Jun 2003 15:39:43 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h5HMdBDZ057728; Tue, 17 Jun 2003 15:39:11 -0700 (PDT) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.9/8.12.9/Submit) id h5HMdAX4057727; Tue, 17 Jun 2003 15:39:10 -0700 (PDT) Date: Tue, 17 Jun 2003 15:39:10 -0700 From: Marcel Moolenaar To: Julian Elischer Message-ID: <20030617223910.GB57040@ns1.xcllnt.net> References: <20030617071810.GA2451@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i cc: threads@FreeBSD.org cc: gareth@nvidia.com cc: aritger@nvidia.com Subject: Re: Nvidia, TLS and __thread keyword -- an observation 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, 17 Jun 2003 22:39:44 -0000 On Tue, Jun 17, 2003 at 03:02:20PM -0700, Julian Elischer wrote: > > > On Tue, 17 Jun 2003, Marcel Moolenaar wrote: > > > Guys, > > > > In short: Don't bash Nvidia. What they do is not uncommon. Well, > > maybe in Open Source environments. So please end this thread, > > unless people get constructive. > > I think its already ended.. > > basically: > We should alwasy be able to use (on i386) the sam amethods outlined for > solaris. > Not quite as quick as those for Linux but more general. I'm not sure you understand the issue (I can easily be wrong, I just don't see the evidence in your statement). To support the __thread keyword, our thread library needs to create the TLS as defined in the binary and its dependent shared libraries by virtue of the .tdata and .tbss sections/segments, based on the image of the TLS as constructed by the RTLD for the initial set of modules (created for the initial thread) and amended by TLS space defined in the dynamicly loaded libraries; and the TLS has to be created for every new thread at the time the thread itself is created. This TLS allocation has to be made accessable in accordance with runtime specifications for the supported architectures (libthr: i386 & ia64; libkse: i386 currently -- more to follow) and in line with the access sequences created by the compiler, and using the static relocations known to the static linker and dynamic relocations of which the support needs to be added to RTLD. The static TLS model requires the least amount of work: add support to allocate the TLS image for every thread creation and point the thread pointer to it in a way compatible with the runtime spec. The dynamic TLS model requires more substantial changes and involves RTLD as well. This is the model that requires __tls_get_addr(). -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net