Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:29777 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77774 invoked by uid 1010); 25 May 2007 22:07:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 77759 invoked from network); 25 May 2007 22:07:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 May 2007 22:07:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=thetaphi@php.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=thetaphi@php.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain php.net from 80.190.230.99 cause and error) X-PHP-List-Original-Sender: thetaphi@php.net X-Host-Fingerprint: 80.190.230.99 www.troja.net Linux 2.5 (sometimes 2.4) (4) Received: from [80.190.230.99] ([80.190.230.99:50540] helo=mail.troja.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/11-03210-41E57564 for ; Fri, 25 May 2007 18:07:18 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.troja.net (Postfix) with ESMTP id 9E0572A45E; Sat, 26 May 2007 00:07:37 +0200 (CEST) Received: from mail.troja.net ([127.0.0.1]) by localhost (cyca.troja.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31297-04; Sat, 26 May 2007 00:07:26 +0200 (CEST) Received: from VEGA (port-83-236-62-78.dynamic.qsc.de [83.236.62.78]) (using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.troja.net (Postfix) with ESMTP id 327042A373; Sat, 26 May 2007 00:07:25 +0200 (CEST) To: "'Rasmus Lerdorf'" Cc: "'Stanislav Malyshev'" , "'PHP Internals'" References: <4657170E.8060701@zend.com> <46571CCC.4030801@zend.com> <46573710.6070800@lerdorf.com> <46573903.2060204@zend.com> <000001c79f12$9b6650b0$0201a8c0@VEGA> <465756D4.1080604@lerdorf.com> Date: Sat, 26 May 2007 00:07:01 +0200 Message-ID: <000001c79f19$05a337d0$0201a8c0@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <465756D4.1080604@lerdorf.com> Thread-Index: AcefFNxy6pkVcZ0KRn2zPoVdrKNK5gAAmQeA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Virus-Scanned: amavisd-new at troja.net Subject: RE: [PHP-DEV] TSRM changes broke windows compile From: thetaphi@php.net ("Uwe Schindler") > > It would be perhaps OK to make TSRM dependent on some global PHP > functions, > > but to make it depend on SAPI code that is only for webserver > interaction > > (!) and not related to TSRM (yes SAPI uses TSRM but not the other way > round) > > is not so good. And that only because of a not IO-related syscall! > > It may not be IO, but on some systems fetching the time is actually > quite expensive. And SAPI isn't only for web server interaction. SAPI > is a general-purpose abstraction API that sits between PHP and anything > PHP talks to. CGI, CLI, and even embedded PHP are all SAPI-driven. > There is no way to use PHP without at least a stub SAPI layer. I know, I wanted only to put more pressure on that. > > A solution would be to make a function pointer inside TSRM that normally > > maps to time() or a TSRM-local wrapper of it. This would make TSRM not > > dependent on PHP. On the PHP part in SAPI startup there could optionally > be > > a redirect of the pointer to SAPI's get_request_time() implementation. > > That could be done, yes. I'm just not sure it is worth the complexity. > TSRM is obviously a PHP-specific thing and it is already somewhat > SAPI-dependant even without this. The THREAD_T and MUTEX_T definitions > change based on the chosen SAPI. This is no longer the case. E.g. when compiling the module for the NSAPI webserver (Sun Java System Webserver) there should be a global define like -DNSAPI in the makefiles (not only for nsapi.c) which is not. Because of that all SAPIs do not have an effect on the thread implementation. When compiling PHP with ZTS you always get an .o file that links to pthreads. This must be the case, because without that it would not be possible to link a CLI PHP in parallel to the webserver specific SAPI. Because of that limitation for example the Sun Webservers on (SJSWS) on AIX crash on startup (there are a lot of bug reports about that, but I cannot help because I have no access to such a system). I only know that SJSWS is implemented on AIX not with POSIX threads. And on Solaris the webservers also crash when you switch to an alternative "kernel" (do not know the exact name) thread implementation in the webserver. This is because the ifdefs in TSRM.h never apply specific to the SAPI implementation. > It doesn't explicitly include SAPI.h > because it relies on the side-effect of TSRM.h being included after the > SAPI stuff. I don't see an explicit include as really changing things > very much. It was just a suggestion. But it should not hard to implement. Uwe