Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40000 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27407 invoked from network); 18 Aug 2008 23:19:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2008 23:19:29 -0000 Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.134.189 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 209.85.134.189 mu-out-0910.google.com Received: from [209.85.134.189] ([209.85.134.189:38132] helo=mu-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/86-25897-E730AA84 for ; Mon, 18 Aug 2008 19:19:28 -0400 Received: by mu-out-0910.google.com with SMTP id i2so1970373mue.3 for ; Mon, 18 Aug 2008 16:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=7kkFpFbJoe+V44ih4BNEE800gQ1Bh+kfl7V8QaUbm3s=; b=M7ITbaFWN6KH6ki2xcNN+PlvgoJRFmxCrh1VsRUlMWdWBl08zVOy70n7kWSsuw4ESc 266vw8tCm4FJwLVyWDHhUX/kQg+oStvGapT7Tv6zm5oyrcKuAXPYvOz8gzSgXNRkY9T3 7f9iSyzV0JRCGQtolIsKYjos3nykZGYWijKPI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=mZsDpSCkSH6N2pxJ6pqRxiAOJMKTPYwH8AmcZkR3HsyHA8BKqpKJ/vtNHNYMvGvkYc FLaLcLEiPv7xqnMz5m7rX7CNOD1vy6bBj3n5ZisXe9RANuqPBk7ghjF17UP1DuJV/tRq UN7paOYVu3iYixgz0Gdg+1mEHuX8/r0Ca6W54= Received: by 10.103.22.11 with SMTP id z11mr4318666mui.106.1219101563053; Mon, 18 Aug 2008 16:19:23 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id j9sm557017mue.3.2008.08.18.16.19.21 (version=SSLv3 cipher=RC4-MD5); Mon, 18 Aug 2008 16:19:22 -0700 (PDT) To: Stanislav Malyshev Date: Tue, 19 Aug 2008 01:17:21 +0200 User-Agent: KMail/1.10.0 (Linux/2.6.26-noch; KDE/4.1.0; i686; ; ) Cc: PHP Development References: <200808170419.11153.arnaud.lb@gmail.com> <48A9DAEC.5090001@zend.com> In-Reply-To: <48A9DAEC.5090001@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200808190117.21410.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] [PATCH] ZTS as fast as non-ZTS From: arnaud.lb@gmail.com (Arnaud Le Blanc) Hi, On Monday 18 August 2008 22:26:20 Stanislav Malyshev wrote: > Hi! > > > The following patch caches each global address in a native TLS variable so > > that accessing a global is as simple as global_name->member. This removes the > > requirement of passing the tls pointer across function calls, so that the two > > major overheads of ZTS builds are avoided. > > I think it would be great to use __thread there. But I think if we have > working __thread, why not have real globals use it, without all that > TSRMG stuff? Having 3 different variants of TSRM support seems excessive. I'm agree with you, but actually TSRM does more that just allocating and storing globals. For instance it keeps track of constructors and destructors so that it can call them automatically when a new thread starts or stops. It also allows to retrieve the globals of an other thread, etc. > > Now, the question is can we reliably detect if we have working __thread > - or, in other words, are there compilers which would accept __thread > but do not implement it correctly, and can those be identified > automatically? For that I checked how the glibc chooses to use __thread or not. Actually it just tries to compile a source like I do in the patch. But as TLS handling needs the help of the libc itself, and the glibc knows it can handle TLS, I guess we will need to do write a more complete test to check if it works and if it works as we expect it to work. > > If we use static declaration with __thread, then as far as I can see > there is no need for separate IDs and all complications following from > that. > > > - Declaring globals statically (--with-tsrm-full-__thread-tls) causes troubles > > to dlopen(), actually Apache wont load the module at runtime (it works with > > just --with-tsrm-__thread-tls). > > What is the problem there, could you elaborate? > -- > Stanislav Malyshev, Zend Software Architect > stas@zend.com http://www.zend.com/ > (408)253-8829 MSN: stas@zend.com > Regards, Arnaud