From owner-freebsd-threads@FreeBSD.ORG Wed Jun 18 11:27:14 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 9865537B401 for ; Wed, 18 Jun 2003 11:27:14 -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 798FE43F93 for ; Wed, 18 Jun 2003 11:27:13 -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 h5IIQfDZ063759; Wed, 18 Jun 2003 11:26:41 -0700 (PDT) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.9/8.12.9/Submit) id h5IIQcde063758; Wed, 18 Jun 2003 11:26:38 -0700 (PDT) Date: Wed, 18 Jun 2003 11:26:38 -0700 From: Marcel Moolenaar To: Terry Lambert Message-ID: <20030618182638.GA63660@ns1.xcllnt.net> References: <20030617223910.GB57040@ns1.xcllnt.net> <002101c3352a$e931a7f0$0701a8c0@tiger> <20030618003556.GA2440@dhcp01.pn.xcllnt.net> <3EF02B40.A4BD1EF@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3EF02B40.A4BD1EF@mindspring.com> User-Agent: Mutt/1.5.1i 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: Wed, 18 Jun 2003 18:27:14 -0000 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. 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... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net