Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65361 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24124 invoked from network); 29 Jan 2013 11:49:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2013 11:49:16 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:34796] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 48/E2-10721-A37B7015 for ; Tue, 29 Jan 2013 06:49:15 -0500 Received: by mail-lb0-f179.google.com with SMTP id j14so606839lbo.38 for ; Tue, 29 Jan 2013 03:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=UaiRh6FQoEs6sFw5M4YdBVn2Jl+yZzH8uuJwhFP35Rw=; b=Nb7BBrN/yJPjSStfhh5cCVMfCRDrvFXpEjnkTXpQ3fvbZfUvSIAfIVop/g/28hIEvo EJ7bLV6Uwb6bpMY0xtoYEkuN74cdl40A8Z54/7bQKK94G5K/NSVS4Wugxi4kbehsZyR8 zo6AER2JezRTr7P9fU1k2c+8HG0fHYeZUgR1IIVLURXGDJBPlxa6kMejmi4tRGNE5YKp O49IGRL0DYOIB26IPankVAd/76DIzEAMrR9vVfU/1TdEAMeHjozmGHg6U/w1iRdZ0YpO mGNrzifzsY3eU/mQbqKtJ/ElPtG7tQ/nSkyBSOb36FQf66y0USToUSNzQdAIANg0RtA1 sQCQ== MIME-Version: 1.0 X-Received: by 10.152.102.177 with SMTP id fp17mr921476lab.0.1359460151259; Tue, 29 Jan 2013 03:49:11 -0800 (PST) Received: by 10.112.2.69 with HTTP; Tue, 29 Jan 2013 03:49:11 -0800 (PST) In-Reply-To: <1359459921.3916.105.camel@guybrush> References: <1359459921.3916.105.camel@guybrush> Date: Tue, 29 Jan 2013 12:49:11 +0100 Message-ID: To: =?ISO-8859-1?Q?Johannes_Schl=FCter?= Cc: Zeev Suraski , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] ZTS - why are you using it? From: pierre.php@gmail.com (Pierre Joye) hi, On Tue, Jan 29, 2013 at 12:45 PM, Johannes Schl=FCter wrote: > On Tue, 2013-01-29 at 12:15 +0100, Pierre Joye wrote: >> >> Laziness and design mistake. Everything on windows (AD,IIS, asp.net, >> etc) >> uses thread. > > Well, most other things don't create "shared-nothing" environments like > PHP does. ASP, not only due to the Application object, for instance > isn't shared-nothing like PHP but sharing state. So what we're doing, > basically, is emulate a separation of threads, similar to what an > operating system should do with processes. > > 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. >> 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)> > What I see is that TSRM brings a lot of complexity and introduces risk > of bugs in there as many developers don't think about. Most of us are > focused on the nice and simple world of single-threaded computing. And I > assume that we can still find quite some threading bugs when going on a > hunt for them ... so besides of pure executable performance there is > also the cost of developer power for (proper) maintenance ... The amount of bugs is rather low. We do test in TS and TS on a daily basis. The last extension causing more critical issues was mysql, we have discussed these bugs for a long time. 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. That does mean we have to keep going with the current state but we must keep it. Other languages support it because most of them are thread safe by design and allows extensions to rely on that. Cheers, -- Pierre @pierrejoye