Re: rewriting run-tests.php

From: Date: Tue, 29 Oct 2002 23:41:07 +0000
Subject: Re: rewriting run-tests.php
References: 1 2 3  Groups: php.qa 
Request: Send a blank email to php-qa+get-6484@lists.php.net to get a copy of this message
On October 29, 2002 06:14 pm, Shane Caraveo wrote: > >>3. multithreaded testing. > > > > Majority of the problems with ZTS builds are the results of various ZTS > > wrappers having bugs in them, 99% of those can be resolved by simply > > adding the --enable-experimental-zts flag and compiling the PHP and then > > running the test suit on the code. > > I don't know why it's still labeled experimental, I guess because it's > on linux. This is how it's been compiled on windows since the start of > php4. You essentially have to have that flag to have a multithreaded > PHP at all. If you don't use it and try entering php with multiple > threads, bang! So it's not so much an issue with the wrappers unless > they are buggy to begin with, but most of the aparent and bad stuff > should already have been caught with the windows builds. The ultimate > issues with thread safety, other than misc. bugs in php's core, are > third party libraries that may or may not be thread safe, or design > issues with specific features in PHP. They need to be identified so > that it can fixed or be documented. A thread based test system should > go some ways in helping to do that. Well, the bugs with Windows builds are often hard to track since often backtraces are unavailable and it is hard to determine wether it is the fault of Windows or PHP or the webserver and so on. Until Apache 2.0, there really has been no need for thread safety on unixes and most people did not use that option (many still don't, since Apache 2.0 is rather unstable atm). IMHO it is up to the configure script to warn and prevent the user from compiling non thread-safe stuff. In fact it already does this for certain modules like msession, you are absolutely correct however in saying that we need to identify which functions/extensions are thread-safe and which aren't. As for fixing, that often that may be out of our hands since the library which is being used in not thread-safe. The thread safety tests themselves need to be completely different from their single thread counter parts. For example, locale functions are not threadsafe (iirc) so doing setlocale('LC_ALL', 'french') will set the locale for all the threads. Now, if our test runs the same script in many threads we won't see a problem since the same locale is being used by all threads and resulting in a correct output. To experience the problem, we'd need to have each thread export a different locale and then try to use locale dependant functions like strtoupper(). Ilia

« previous php.qa (#6484) next »