Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104423 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 62769 invoked from network); 14 Feb 2019 21:14:03 -0000 Received: from unknown (HELO wout2-smtp.messagingengine.com) (64.147.123.25) by pb1.pair.com with SMTP; 14 Feb 2019 21:14:03 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 7C17C2D74 for ; Thu, 14 Feb 2019 12:57:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 14 Feb 2019 12:57:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=28C1wH YLY4YJ7fVJxdwYtVsRSP3eGCDIt6/Nly+4oLA=; b=ZJLoQg91VMQYB/ZGuMz29x E8hdCtK5N/bfPGsVFfJOfJZHuKyYZ5oiUfWqXi4Vj6tBxWqxXNKdgP2nI6u7yPtC 2MwIAzweICsraskzVppRakfHMcBKqyDMYmltAV/+zSc4gFA1Q6NczhnRwP41VIsz AQguqci3FQsjcAk0dwZZRW6kOEkhi4iucWREXVTMUHSqgi6caNzsTL60cbT4Sg+b vtxn3OZNuH2w30eK+hsirPYPaKGeTMsYYepJB1pI2ieLCTrnoArqapmCLZM3mFkw cal5LMFX98zHeOToiMFF0Uaq/5FCG2MVAoxkj3M/WdbnOwdDp+O8PGCctKUqqYaQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddthedguddtiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecu fedttdenucgfrhhlucfvnfffucdluddtmdenucfjughrpefhvffufffkjghfgggtsehgtd erredttddvnecuhfhrohhmpefnrghrrhihucfirghrfhhivghlugcuoehlrghrrhihsehg rghrfhhivghlughtvggthhdrtghomheqnecuffhomhgrihhnpegrphgrtghhvgdrohhrgh dpphhhphdrnhgvthdpkhhrrghkjhhovgdrnhhinhhjrgenucfkphepvdduiedrkedtrdef tddrudehvdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlh guthgvtghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from vulcan.localnet (216-80-30-152.s3222.c3-0.frg-cbr1.chi-frg.il.cable.rcncustomer.com [216.80.30.152]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B0F61031B for ; Thu, 14 Feb 2019 12:57:27 -0500 (EST) To: internals@lists.php.net Date: Thu, 14 Feb 2019 11:57:22 -0600 Message-ID: <1882693.l3SFSfi3S3@vulcan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2276675.dyxsxvvUx7"; micalg="pgp-sha512"; protocol="application/pgp-signature" Subject: Re: [PHP-DEV] Re: ZTS improvement idea From: larry@garfieldtech.com (Larry Garfield) --nextPart2276675.dyxsxvvUx7 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Thursday, February 14, 2019 9:59:18 AM CST Rowan Collins wrote: > On Thu, 14 Feb 2019 at 15:47, Christoph M. Becker wrote: > > On 14.02.2019 at 12:56, Zeev Suraski wrote: > > > On Wed, Feb 13, 2019 at 11:26 AM Joe Watkins wrote: > > >> The ZTS build is very commonly used in Windows today > > > > > > Any idea why? > > > > windows.php.net: > > | With Apache you have to use the Thread Safe (TS) versions of PHP. > > Ah, that makes sense; the only Apache MPM supported on Windows is > mpm_winnt, which is thread-based: > http://httpd.apache.org/docs/2.4/mod/mpm_winnt.html > > Again, this only makes sense if using server modules (mod_php); anyone > using FastCGI will presumably be unaffected. > > > All that being said, it would be nice if ZTS became more mainstream, so > more people had access to userland threading / parallel processing > extensions. > > Regards, Data point: At Platform.sh (web host), we've been running ZTS builds of 7.1, 7.2, and 7.3 exclusively for a while now. We don't even offer non-ZTS versions of those releases. It's been quite solid, and mysteriously even slightly faster than the non-ZTS version of 7.1 on code that wasn't doing anything threaded at all (which surprised me, but hey). I have to agree with Joe's post yesterday on this front: https://blog.krakjoe.ninja/2019/02/parallel-php-next-chapter.html It's not threads that are unsafe for end users; it's badly designed thread APIs that start by pointing a gun at your foot. :-) A well-designed thread- backed concurrency model (Go routines being a good but not the only example) is way better, and at least from a user side I frankly prefer it to async IO. You get much of the same benefits with less need to restructure you're code, even with async/await. Plus you can parallelize CPU intensive tasks, something async IO simply cannot do. I'm not against the efforts to add async IO to PHP, but it's not an either/or with thread-safe code. I'd also love to see more non-IO-bound concurrency added to the language. --Larry Garfield --nextPart2276675.dyxsxvvUx7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEE/ph/GXfY8v0YwFBp4MMKwDFxYXcFAlxlrAIACgkQ4MMKwDFx YXdHHQgAh3hyc4achqRja7fZv7QHoj5lS1PprCFJwJFVL+NeW0+blY5zaU+1rURs lwyTmSjDg4JwORxA0ivDYALZV9DaQsJsym5rPNkNN6Js86xy2t7u+wa68rt+1v2X mTGjL+2KqnG4wZe7SvcwV1L4DM8MMc4aQXsAM32KNBtFR54pa2SFz0gs+dzEdEMm yA5gTdfYfF+lZmSmZ7WMU0B+DV21E6Kaz0a0fHLa2UNC09YnvhuNybbHczH6QyjW hxeYBgPNGIjDGl/9/9iyllMmsQnso0H4JaCLagA23xmFMYbJFHqOz1/8eIs7vfC/ 1fiUqWxq3kz+zZ+rp/nOMKi4CV6WcQ== =s6eH -----END PGP SIGNATURE----- --nextPart2276675.dyxsxvvUx7--