Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65369 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37692 invoked from network); 29 Jan 2013 12:52:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 12:52:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain zend.com does not designate 209.85.219.51 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.219.51 mail-oa0-f51.google.com Received: from [209.85.219.51] ([209.85.219.51:46399] helo=mail-oa0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/A5-10721-516C7015 for ; Tue, 29 Jan 2013 07:52:38 -0500 Received: by mail-oa0-f51.google.com with SMTP id n12so369094oag.10 for ; Tue, 29 Jan 2013 04:52:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:references:in-reply-to:mime-version:x-mailer :thread-index:date:message-id:subject:to:cc:content-type :content-transfer-encoding:x-gm-message-state; bh=AI3W045FsOZ78cdnhlZU/snKwt69KIRLj6SHCh7PFq8=; b=R/vdEY9odWaI91zQHoJYE06MqxX6RKGRYsCKtQfSvHghvQXuDj8gWctbPYwLPEfeXC /i3aE8mBdKfIIeE+RtItCLCb1aARQ79/8WGOK0pzolR2N7mi8HmC672AMN/M/uHvaI6c 55G+R09vNuO+nmaZMWtiaGZewPToCJx7HLDtoiz3auSNmqWd4lMpNQDeutr0O3ezAnBd qNgkYZRi57Z/YCwveM2SvTMfGuZ15d/e+PFYQgCQh4GrDWJEj7GboeLE24P5HqXKL2E4 /XaGUZeVdNnPOW7i36DwxmIfrnMmFBSWvGEvZaKRYR0B0u6s/cwPScmB0VY8x4wxwwvF Jr9g== X-Received: by 10.182.72.69 with SMTP id b5mr667979obv.4.1359463955120; Tue, 29 Jan 2013 04:52:35 -0800 (PST) References: <1359459921.3916.105.camel@guybrush> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJJdUzE2iPwKiwvzciYvchG03LAWgHrKhe1AkgXmvEAyNLsagInIOvjAjNe6uACi4oZMwH0VTMxlvqbMHA= Date: Tue, 29 Jan 2013 14:52:34 +0200 Message-ID: To: Pierre Joye Cc: =?UTF-8?Q?Johannes_Schl=C3=BCter?= , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmejEj6QZoHxEt/w/kFPWHfgjYNkdYbmU61fhvZZlnpHnUt6z8mDQNTlAKrSuWJB3jk7E2SDRl6bDRet2bmuPtEaeOPfTjlI5OIlG9GmfetPq646Pijdjt0km7Q2IfhfMfaThY2 Subject: RE: [PHP-DEV] ZTS - why are you using it? From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Pierre Joye [mailto:pierre.php@gmail.com] > Sent: Tuesday, January 29, 2013 2:19 PM > To: Zeev Suraski > Cc: Johannes Schl=C3=BCter; PHP internals > Subject: Re: [PHP-DEV] ZTS - why are you using it? > > On Tue, Jan 29, 2013 at 1:06 PM, Zeev Suraski wrote: > > >> It is inter process sharing and is very expensive, nothing to compare > > with shared > >> memory within a single process, accross many threads. > > > > What are you basing that assertion on? Shared memory should have > > identical performance to regular process memory. It's mapped in very > > similar way. > > Testing maybe? Retest then, you've got it wrong. Shared memory (or memory mapped files as they'd be on Windows) are simply memory, it's available to the process in exactly the same way and while the OS does slightly different book-keeping for it in how it populates the pages - it's negligible. > >> >> Miss the rest of my mail or? Current implementation is outdated > >> >> and slow. > >> > > >> > That is true. Many modern compilers and environments provide > >> > better support for thread local storages .... > >> > >> Exactly, or more exactly CRTs (libc, crt and the likes)> > > > > Can we stop arguing about the implementation > > No, we can't. The main reason of the bugs and performance issue is due to the > current implementation and how extensions developers have to deal with it. It is > not separable from discussing what could be the worst decision we ever made, > droping thread safety. Well, I'm not interested in discussing the implementation when the need isn't clear to me. For example, you could say that thread-safe PHP would be 2x faster. Or 2x more memory efficient. Or will enable us to do XYZ which we otherwise can't. For now, an *utopian* ZTS mode would, at best, not give us anything. Even if we put aside the performance/reliability issues - why would someone want that mode over other modes? > > So far the only real use case that was brought up was for using > > pthreads in a long-running app. I've yet to hear about a single real > > reason of why someone would want to use it in web server context that > > is not based on misconceptions or myths. > > Thanks, it is really nice to say something and being told that what has been done > is misconceptions or myths, especially if you gave up on thread safety years ago > within your company. That's all good, as long as it only affects your company > products and not PHP as a whole. Pierre, I'm sorry, but when you state something like '[shared memory] is inter process sharing and is very expensive', there's no other way to describe it other than a myth. Better theoretical performance is a misconception. The best PHP performance/density available today is on nginx, which couldn't be farther away from multithreaded-PHP-in-process-arch. Even after what you just said, you've yet to bring up a single reason for why one would want to use ZTS inside a web server context. You seem to love ZTS with a vengeance but you can't quite explain why. My 'company' didn't decide anything regarding ZTS. It was me, probably the person with the most experience with ZTS back in the day, and it was probably much more difficult for me than anybody else to realize that the ZTS approach was the wrong path to go to as it was my baby project. BTW, for the love of [insert here], I'm not talking about killing thread safety. It's useful for long running processes, and who knows, maybe in the future we'll have threads inside PHP. But I *am* talking about telling people that using ZTS in production is not recommended and that they should be using FastCGI instead. Zeev