Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65364 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28949 invoked from network); 29 Jan 2013 12:06:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 12:06:43 -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.214.169 as permitted sender) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:52770] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/E3-10721-25BB7015 for ; Tue, 29 Jan 2013 07:06:43 -0500 Received: by mail-ob0-f169.google.com with SMTP id ta14so319175obb.28 for ; Tue, 29 Jan 2013 04:06:40 -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=xkUpJt2KIH79K27k20oNd5QJiq+yB5Bs9AKT9hlCY1M=; b=WGOjFArRhndPZlCdMNl1QSmao9B/AC+0hrPFvwOUI0b/fZkKQCEWUc4KxhI404H5Cl TiyQhxGNGCnSNVnaIINzbaJ4aYWPk3NWwW9i2IfL/Tsuyq5evErPz/K2Bc0g+v6SfsSD cfOesIIYJfPCiAfcxTpM2DJuc2IP94t81CS1Yf7F1LSokcU/tJdQsXVX6OUb/QWkEFgB 12BNoNjdySJ7XwksG9fkk7K/UfEQfNWGto/75TjCSYprbMbg7S18X8dj9pgcmJ8jefWy 6jFC+XUm8daBtYe87lOs2q6D1mU3IMWExS3EhEBWkcXzltUu5ZQ/6GTGUVF6YME9hisy QTng== X-Received: by 10.182.72.69 with SMTP id b5mr574498obv.4.1359461200498; Tue, 29 Jan 2013 04:06:40 -0800 (PST) References: <1359459921.3916.105.camel@guybrush> In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJJdUzE2iPwKiwvzciYvchG03LAWgHrKhe1AkgXmvEAyNLsagInIOvjAjNe6uCXHo9K4A== Date: Tue, 29 Jan 2013 14:06:39 +0200 Message-ID: To: Pierre Joye , =?UTF-8?Q?Johannes_Schl=C3=BCter?= Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkJhLQOWxXSDXZLvZcjxsggkqhIp1W4R5U1a0onpIITSlcKZocYPPALk3g7y8Hel/FM1N0wl+H3RNPy9MjUpZ3bD84KCSj7QqrEsCmnSk51+j1qWRPEBoEXDrKORupXKX9kU3Wu 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 1:49 PM > To: Johannes Schl=C3=BCter > Cc: Zeev Suraski; PHP internals > Subject: Re: [PHP-DEV] ZTS - why are you using it? > > On Tue, Jan 29, 2013 at 12:45 PM, Johannes Schl=C3=BCter > wrote: > > On Tue, 2013-01-29 at 12:15 +0100, Pierre Joye wrote: > > Of course an opcode cache isn't shred-nothing either, and maybe > > sharing opcodes within a process is faster than doing this in shared memory. > > 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. There are effectively no performance advantages to using multiple threads over multiple processes, none whatsoever. It might help you a bit with memory consumption - but in the case of PHP, FastCGI with it's n:m mapping is much superior to it. Using multiple threads only makes sense if you take functional advantage of that, like shared objects and such - which we don't. > >> 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 - which I didn't even bring up in my original mail - and focus on the original question - why would you want thread safe PHP in the first place? 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. > However let me state my point clear: Giving up on thread safety would be a > mistake as big as safemode and other insane choices we made. As big as giving up on safe mode or creating it in the first place? If it's the former, I say let's do it right now :) Zeev