> -----Original Message----- > From: Pierre Joye [mailto:pierre....@gmail.com] > Sent: Tuesday, January 29, 2013 1:49 PM > To: Johannes Schlüter > 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üter > <johan...@schlueters.de> 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php