From owner-freebsd-threads@FreeBSD.ORG Wed Jun 18 23:40:28 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 1866337B401 for ; Wed, 18 Jun 2003 23:40:28 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 776CC43F93 for ; Wed, 18 Jun 2003 23:40:27 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-2ivfk2f.dialup.mindspring.com ([165.247.208.79] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19St5c-00057n-00; Wed, 18 Jun 2003 23:40:09 -0700 Message-ID: <3EF15A83.D869E0C9@mindspring.com> Date: Wed, 18 Jun 2003 23:38:59 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Marcel Moolenaar References: <20030617223910.GB57040@ns1.xcllnt.net> <002101c3352a$e931a7f0$0701a8c0@tiger> <20030618003556.GA2440@dhcp01.pn.xcllnt.net> <3EF02B40.A4BD1EF@mindspring.com> <20030618182638.GA63660@ns1.xcllnt.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4d198646b967cb52024b77e6d0c7aa962667c3043c0873f7e350badd9bab72f9c350badd9bab72f9c cc: David Xu cc: Julian Elischer cc: threads@freebsd.org 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: Thu, 19 Jun 2003 06:40:28 -0000 Marcel Moolenaar wrote: > On Wed, Jun 18, 2003 at 02:05:04AM -0700, Terry Lambert wrote: > > Marcel Moolenaar wrote: > > > On Wed, Jun 18, 2003 at 07:48:09AM +0800, David Xu wrote: > > > > I believe this will add overhead to thread creating and destroying, > > > > How fast an RTLD can be in this case ? > > > > > > In the dynamic TLS model you would like to delay the creation of > > > the TLS space. Normally __tls_get_addr() gets used for this. In > > > the static TLS model you allocate the TLS when you llocate the > > > thread control structure. > > > > Lazy binding in this context doesn't make a lot of sense. > > It does. In a process with 1000 threads where 1 thread does > a dlopen(), you don't want to create 999 TLS spaces if they're > not going to be used. Besides time, this also is a space > issue. If you wanted to save space, you would not be using per thread storage in the first place. 8-). Time is only an issue if you are talking .tdata; the .tbss is all zeroed, so could be allocated as a very large block, with relatively no initialization overhead. > Note also that I don't advocate what I think we should do, but > what the specification is designed for. People have put some > thought in it... I understand the specification's intent, both the purely technical, and the political. -- Terry