On Thursday, February 14, 2019 9:59:18 AM CST Rowan Collins wrote: > On Thu, 14 Feb 2019 at 15:47, Christoph M. Becker <cmbecke...@gmx.de> wrote: > > On 14.02.2019 at 12:56, Zeev Suraski wrote: > > > On Wed, Feb 13, 2019 at 11:26 AM Joe Watkins <krak...@gmail.com> 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
signature.asc
Description: This is a digitally signed message part.