> > > We could of course mutex every call to every external function. Then we > > > could be reasonably sure it would work, and at the same time we could be > > > sure that it was much slower than running it non-threaded. > > > > Any crash in an area protected by mutex would leave this mutex in > > non-released state and all the rest threads trying to access that area would > > be blocked forever. > > A crash in a multi-threaded program most likely leads to the > termination of the process, so this is a non-issue.
Okay. Suppose it's the best solution to avoid hangs.... :-) > > BTW, is there any way for checking if a library does not create nor use any > > global variables ? May be just running nm with non-stripped .so objects and > > inspecting the resulting list ? Any other ideas ? > > nm displays global variables, including static function-scope > variables. However, you cannot discern whether their use is > save unless you audit the source code. I agree but I meant different thing. Everybody understand that sources must be audited but nobody want to do it just because they are too big and all the process would be just wasting the time. At least withought cliear understanding what to do after a snapshot is audited. Nobody would like to do the same work twice. Look, if a library (or function) does not use global variables nor call to other functions that are explicitly marked as a non-reentrant (should a list be opened for it?), this library can be safely used in multithreaded environment and thus the list of remained code to be audited can be made fewer. Isn't it ? Don't you agree that it's nearly impossible to audit all the code including all the extensions. Even if anybody audited a particular snapshot of all sources what to do with it after other people have made modifications ? I believe there must be an automated process that should be tightly integrated in to building scripts. As a result we should get a list of all functions with one of the following "CLEAR" "TO BE AUDITED" "NON REENTRANT". Any further ideas ? -dmitri. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php