Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:2966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69615 invoked by uid 1007); 29 Jun 2003 10:10:27 -0000 Message-ID: <20030629101027.69614.qmail@pb1.pair.com> To: internals@lists.php.net Reply-To: "Dmitri Dmitrienko" References: <20030628055230.56980.qmail@pb1.pair.com> <3EFD3147.6060104@webgenius.co.nz> <20030628095832.10285.qmail@pb1.pair.com> Date: Sun, 29 Jun 2003 14:10:19 +0400 Lines: 53 X-Newsreader: Microsoft Outlook Express 6.00.2800.1081 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1081 X-Posted-By: 212.5.65.148 Subject: Re: [PHP-DEV] Apache 2 support From: dd@cron.ru ("Dmitri Dmitrienko") > > > 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.