Newsgroups: php.cvs,php.internals Path: news.php.net Xref: news.php.net php.cvs:82002 php.internals:77692 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60235 invoked from network); 29 Sep 2014 06:55:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2014 06:55:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.181 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.181 mail-vc0-f181.google.com Received: from [209.85.220.181] ([209.85.220.181:61537] helo=mail-vc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/71-38877-44209245 for ; Mon, 29 Sep 2014 02:55:01 -0400 Received: by mail-vc0-f181.google.com with SMTP id hq12so4992898vcb.40 for ; Sun, 28 Sep 2014 23:54:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=dFzw+KrHYt7kx1mbJhb2gjyG7Z8mEdFX8N9PaLXRhFQ=; b=bXqIkTE+AB2DCFIdLxXDfLrZ6vo7SDHrrXwqHuhHofbPEN2Kt7WZ04wH+UXW63n8HY NwCNBv2k0pCBnP8fbT0OPnJJzAIcHopU6Id3cTXoRnKzi7KqNZgZ7Y0pjaVZ+CAsXnvJ HjD3R3G5oFFO/A2pkqsw78I71H+1IpriZH9KjzUhBb6XGdnSXZXPOwkyMbz3OECgx2/q PHzd8MQchtYHke0+8sefduOKk1SS5MGHl4Q+BVndsZAsVkIFecndZp5ukzPCVfy8Foua 6poZEUIjrzy7LNlJOph0RGeodiRbccJ3619yAt68vfVz7wDS7a6vfSsCCMYgqTI2LwHk SM/g== X-Gm-Message-State: ALoCoQlbPSJ2e3wZVsgnRl0S6pL/1hlbyh2yXX9f+dDaB/NHVw2JL7TNjXFex4lKdLhkqvohhlXioz8Bo31ibtwygYSBRdedaqdNZZS4E1Hu8cmHS1VQn328LslcCxmijPkA00VtvuYuNYWxyFVfaYVII/F7+7+wpQ== MIME-Version: 1.0 X-Received: by 10.221.64.2 with SMTP id xg2mr26636985vcb.18.1411973696939; Sun, 28 Sep 2014 23:54:56 -0700 (PDT) Received: by 10.52.158.197 with HTTP; Sun, 28 Sep 2014 23:54:56 -0700 (PDT) In-Reply-To: <57df99a6abdfeeb9036b529fb83175bd.squirrel@webmail.klapt.com> References: <35865ab5a49aa7711727174e173d0723.squirrel@webmail.klapt.com> <57df99a6abdfeeb9036b529fb83175bd.squirrel@webmail.klapt.com> Date: Mon, 29 Sep 2014 10:54:56 +0400 Message-ID: To: Anatol Belski Cc: Joe Watkins , Anatol Belski , Nikita Popov , "php-cvs@lists.php.net" , PHP Internals , Pierre Joye , Xinchen Hui Content-Type: multipart/alternative; boundary=001a11334da0a37adb05042ebe87 Subject: Re: [PHP-DEV] Re: [PHP-CVS] com php-src: fix CG(empty_string) init in ZTS: Zend/zend.c From: dmitry@zend.com (Dmitry Stogov) --001a11334da0a37adb05042ebe87 Content-Type: text/plain; charset=UTF-8 Hi Anatol. I'll take a look on Tuesday or Wednesday. Thanks. Dmitry. On Sat, Sep 27, 2014 at 12:59 AM, Anatol Belski wrote: > Hi Dmitry, > > On Mon, September 22, 2014 08:43, Dmitry Stogov wrote: > > Hi Anatol, > > > > > > I didn't completely get your ideas, but if tsrm_ls_cache can't be > > exported on Windows directly, can we have a copy of tsrm_ls_cache in each > > DLL/EXE > > and initialize it once? > > > > Thanks. Dmitry. > > > Joe and me was working on this and there is a worky version now. Generally > it suffers from some issues already present in master, but in all things > together it's a worky crossplatform approach. Please look up the > native-tls branch. > > For the current variant I used the idea from the original RFC, but removed > exporting the TSRM cache through a __thread variable as it's not portable. > I've also removed the offset logic from the RFC patch, as that brought > additional hard to find bugs especially into the current unstable version. > I don't think it's necessary to copy the arbitrary globals structs in > every ext, further more i think it's not easy possible without some big > overhead. However even with the current native-tls branch I'm able to run > wordpress, symfony, ab -c 8 -n 2048 pass also with multiple calls. Still, > some Apache bugs are already reported against master, I also repro some > others, mostly arbitrary shutdown crashes in Apache (so TS version). So as > they're in master, they're for sure in native-tls. > > PHP happens to always have used TLS, however the pointer was passed > directly to the functions. In TSRM.c, that's tsrm_tls_get/tsrm_tls_set. > Now, a function wrapper is used to fetch the TLS cache directly in the > TSRMG macro. This makes the whole slowlier, but allows to get rid of the > TSRMLS_* macros. The big question is to optimize the function call to > speedup the whole. Maybe one can speedup it saving a tsrm ls cache pointer > locally per extension or code area. ATM we're checking the functional > part, then one can proceed further with removing the TSRMLS_* macros. Any > speedup or improvement thoughts are welcome. > > Possible directions of the further work after known bugs are fixed (in > master or in native-tls), some are mutually exclusive > > - reimplement the offset logic instead of arrays for the globals structs > - share the tsrm cache pointer globally to some scope, like extension or > sapi > - remove the linked lists logic and use TLS explicitly > - improve locking > > Thanks > > Anatol > > --001a11334da0a37adb05042ebe87--